posixpath.expandvars(). Fixed all os.path implementations on
unicode-disabled builds.
+- Issue #23367: Fix possible overflows in the unicodedata module.
+
- Issue #23363: Fix possible overflow in itertools.permutations.
- Issue #23364: Fix possible overflow in itertools.product.
stackptr = 0;
isize = PyUnicode_GET_SIZE(input);
+ space = isize;
/* Overallocate at most 10 characters. */
- space = (isize > 10 ? 10 : isize) + isize;
+ if (space > 10) {
+ if (space <= PY_SSIZE_T_MAX - 10)
+ space += 10;
+ }
+ else {
+ space *= 2;
+ }
result = PyUnicode_FromUnicode(NULL, space);
if (!result)
return NULL;