Issue #16335: Fix integer overflow in unicode-escape decoder.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 80a70b6..ddd8d53 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3923,7 +3923,8 @@
                     /* 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), &chr))
+                    if (s - start - 1 <= INT_MAX &&
+                        ucnhash_CAPI->getcode(NULL, start, (int)(s-start-1), &chr))
                         goto store;
                 }
             }