[New-bugs-announce] [issue29444] Out-of-bounds buffer access in match_getslice_by_index

WGH report at bugs.python.org
Sat Feb 4 11:23:03 EST 2017


New submission from WGH:

In [1]: import re

In [2]: b = bytearray(b'A'*100)

In [3]: m = re.search(b'A*', b)

In [4]: m.group()
Out[4]: b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'

In [5]: del b[:]

In [6]: m.group()
Out[6]: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x9a\xc4\xb2i\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

I will attach the patch shortly.

----------
components: Regular Expressions
messages: 286974
nosy: WGH, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Out-of-bounds buffer access in match_getslice_by_index
type: security
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29444>
_______________________________________


More information about the New-bugs-announce mailing list