mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
Issue #16335: Fix integer overflow in unicode-escape decoder.
This commit is contained in:
commit
c35f3a9f61
2 changed files with 18 additions and 1 deletions
|
@ -5696,7 +5696,8 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
|
|||
/* found a name. look it up in the unicode database */
|
||||
message = "unknown Unicode character name";
|
||||
s++;
|
||||
if (ucnhash_CAPI->getcode(NULL, start, (int)(s-start-1),
|
||||
if (s - start - 1 <= INT_MAX &&
|
||||
ucnhash_CAPI->getcode(NULL, start, (int)(s-start-1),
|
||||
&chr, 0))
|
||||
goto store;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue