]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-105235: Prevent reading outside buffer during mmap.find() (… (#106710)
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Sat, 15 Jul 2023 02:17:09 +0000 (22:17 -0400)
committerGitHub <noreply@github.com>
Sat, 15 Jul 2023 02:17:09 +0000 (22:17 -0400)
commitd488970ae6e4b0de1212e202602be686de49ab7a
treeda5b982a63c3abd4e84fc0591b8a33150535b8e6
parent2186212191f2ef149d73073b4583d74a49d176e2
[3.11] gh-105235: Prevent reading outside buffer during mmap.find() (… (#106710)

[3.11] gh-105235: Prevent reading outside buffer during mmap.find() (GH-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.
(cherry picked from commit ab86426a3472ab68747815299d390b213793c3d1)
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