mirror of
https://github.com/python/cpython.git
synced 2025-07-25 12:14:38 +00:00
Issue #16975: Fix error handling bug in the escape-decode bytes decoder.
This commit is contained in:
commit
e58785b200
3 changed files with 50 additions and 0 deletions
|
@ -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--;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue