]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-106844: Fix issues in _winapi.LCMapStringEx (GH-107832)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 11 Aug 2023 18:13:46 +0000 (21:13 +0300)
committerGitHub <noreply@github.com>
Fri, 11 Aug 2023 18:13:46 +0000 (21:13 +0300)
commit04cc01453db2f0af72a06440831637f8bf512daf
tree84854fa4bd5b10588eef404a2c22fe65ad25a244
parenta39f0a350662f1978104ee1136472d784aa6f29c
gh-106844: Fix issues in _winapi.LCMapStringEx (GH-107832)

* Strings with length from 2**31-1 to 2**32-2 always caused MemoryError,
   it doesn't matter how much memory is available.
* Strings with length exactly 2**32-1 caused OSError.
* Strings longer than 2**32-1 characters were truncated due to integer overflow bug.
* Strings containing the null character were truncated at the first null character.

Now strings longer than 2**31-1 characters caused OverflowError and the null character is allowed.
Lib/test/test_ntpath.py
Misc/NEWS.d/next/Windows/2023-07-18-13-01-26.gh-issue-106844.mci4xO.rst [new file with mode: 0644]
Modules/_winapi.c
Modules/clinic/_winapi.c.h