diff options
Diffstat (limited to 'python/binaryview.py')
| -rw-r--r-- | python/binaryview.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index 6ecca2dc..612632d3 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -1939,6 +1939,8 @@ class BinaryView(object): >>> bv.read(0,4) \'\\xcf\\xfa\\xed\\xfe\' """ + if (addr < 0) or (length < 0): + raise ValueError("length and address must both be positive") buf = databuffer.DataBuffer(handle=core.BNReadViewBuffer(self.handle, addr, length)) return bytes(buf) |
