diff -r 59a189a15933 Objects/unicodeobject.c --- a/Objects/unicodeobject.c Thu Oct 25 17:23:54 2012 -0700 +++ b/Objects/unicodeobject.c Sat Oct 27 01:23:04 2012 +0300 @@ -5539,10 +5539,9 @@ /* look for the closing brace */ while (*s != '}' && s < end) s++; - if (s > start && s < end && *s == '}') { + if (s > start && s < end && s++ - start <= INT_MAX) { /* 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, 0)) goto store;