New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out-of-bounds buffer access in match_getslice_by_index #73630
Comments
In [1]: import re In [2]: b = bytearray(b'A'*100) In [3]: m = re.search(b'A*', b) In [4]: m.group() In [5]: del b[:] In [6]: m.group() I will attach the patch shortly. |
Thank you for your patch WGH. It is correct and fixes out-of-bounds buffer access. But I don't know what would be the better solution: silently adjust indices or raise RuntimeError? |
Python 2.7 (CPython and PyPy) and also PyPy's Python 3 adjust the indices, like my patch does, if that matters. |
Ah, this is good reason. The patch LGTM. |
New changeset 4e65d6c20dae by Serhiy Storchaka in branch '3.5': New changeset 393969776989 by Serhiy Storchaka in branch '3.6': New changeset 476b0fa34db4 by Serhiy Storchaka in branch 'default': |
New changeset 83d13325dec591676eeafb12a4caa01a67ef2f7e by Serhiy Storchaka in branch 'master': New changeset 929374345586086c9860a3937b275511dcc8185a by Serhiy Storchaka in branch 'master': New changeset e0a10190f88e474a159da92b7b5be472e0d7f325 by Serhiy Storchaka in branch 'master': |
New changeset 83d13325dec591676eeafb12a4caa01a67ef2f7e by Serhiy Storchaka in branch '3.6': New changeset 929374345586086c9860a3937b275511dcc8185a by Serhiy Storchaka in branch '3.6': |
Misc/NEWS
so that it is managed by towncrier #552Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: