summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:33:22 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:33:22 (GMT)
commitf584aba3a506e72a59e2e834bc56a6e97f4ab4dd (patch)
tree781cc4a2bf45328208ea06ca0bb6427a42a6c788 /Objects
parent13252b877016aa5380f4ae36fb024671c2ea77db (diff)
parente58785b200241bc9ced51a30bce7781a3c0c629c (diff)
downloadcpython-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.c4
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--;