Commit 2ad602bb authored by hjk's avatar hjk

Debugger: Put some restrictions on byte array dumper

This makes 100M a hard limit, reducing the likelihood that an
uninitialized byte array will look valid.

Change-Id: I51dc5f39e0c7327faa8c1d0640934a6074d8c559
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent ec2b006d
......@@ -58,6 +58,7 @@ def qform__QByteArray():
def qdump__QByteArray(d, value):
data, size, alloc = d.byteArrayData(value)
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 100)
d.putNumChild(size)
elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit)
displayFormat = d.currentItemFormat()
......@@ -78,6 +79,7 @@ def qdump__QByteArray(d, value):
def qdump__QByteArrayData(d, value):
data, size, alloc = d.byteArrayDataHelper(d.addressOf(value))
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 100)
d.putValue(d.readMemory(data, size), Hex2EncodedLatin1)
d.putNumChild(1)
if d.isExpanded():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment