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

This commit is contained in:
Serhiy Storchaka 2013-01-25 23:31:43 +02:00
parent 697e56d0f5
commit ace3ad3bf7
3 changed files with 50 additions and 0 deletions

View file

@ -484,6 +484,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--;