Issue #16975: Fix error handling bug in the escape-decode bytes decoder.

This commit is contained in:
Serhiy Storchaka 2013-01-25 23:32:41 +02:00
commit e58785b200
3 changed files with 50 additions and 0 deletions

View file

@ -480,6 +480,10 @@ PyObject *PyBytes_DecodeEscape(const char *s,
errors);
goto failed;
}
/* skip \x */
if (s < end && Py_ISXDIGIT(s[0]))
s++; /* and a hexdigit */
break;
default:
*p++ = '\\';
s--;