]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845)
authorwmeehan <wmeehan@users.noreply.github.com>
Thu, 27 Aug 2020 05:45:25 +0000 (01:45 -0400)
committerGitHub <noreply@github.com>
Thu, 27 Aug 2020 05:45:25 +0000 (14:45 +0900)
commit97eaf2b5e5c826b9abe59896a363853bef55c5d9
tree6c9743b196087bd35722f08aec8c7aaa12d3aed7
parent022bc7572f061e1d1132a4db9d085b29707701e7
bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845)

* bpo-41524: fix pointer bug in PyOS_mystr{n}icmp

The existing implementations of PyOS_mystrnicmp and PyOS_mystricmp
can increment pointers beyond the end of a string.

This commit fixes those cases by moving the mutation out of the condition.

* ðŸ“œðŸ¤– Added by blurb_it.

* Address comments

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Misc/NEWS.d/next/C API/2020-08-12-17-09-06.bpo-41524.u6Xfr2.rst [new file with mode: 0644]
Python/pystrcmp.c