]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-105235: Prevent reading outside buffer during mmap.find() (#105252)
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Thu, 13 Jul 2023 02:50:45 +0000 (22:50 -0400)
committerGitHub <noreply@github.com>
Thu, 13 Jul 2023 02:50:45 +0000 (22:50 -0400)
commitab86426a3472ab68747815299d390b213793c3d1
tree64e15afa53d2d037a1e80c0b102e2903be7c61d8
parent2d43beec225a0495ffa0344f961b99717e5f1106
gh-105235: Prevent reading outside buffer during mmap.find() (#105252)

* Add a special case for s[-m:] == p in _PyBytes_Find

* Add tests for _PyBytes_Find

* Make sure that start <= end in mmap.find
Lib/test/test_mmap.py
Misc/NEWS.d/next/Core and Builtins/2023-06-02-19-37-29.gh-issue-105235.fgFGTi.rst [new file with mode: 0644]
Modules/_testinternalcapi.c
Modules/mmapmodule.c
Objects/bytesobject.c