diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-25 21:33:22 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-25 21:33:22 (GMT) |
commit | f584aba3a506e72a59e2e834bc56a6e97f4ab4dd (patch) | |
tree | 781cc4a2bf45328208ea06ca0bb6427a42a6c788 /Objects | |
parent | 13252b877016aa5380f4ae36fb024671c2ea77db (diff) | |
parent | e58785b200241bc9ced51a30bce7781a3c0c629c (diff) | |
download | cpython-f584aba3a506e72a59e2e834bc56a6e97f4ab4dd.zip cpython-f584aba3a506e72a59e2e834bc56a6e97f4ab4dd.tar.gz cpython-f584aba3a506e72a59e2e834bc56a6e97f4ab4dd.tar.bz2 |
Issue #16975: Fix error handling bug in the escape-decode bytes decoder.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytesobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 91f65f9..20de5cc 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -489,6 +489,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--; |