summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:31:43 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:31:43 (GMT)
commitace3ad3bf79a8a3b0ea9d1de97c8f8b59d1ac7b2 (patch)
treecdf8d1abca62783de7eafefcc9e924b34f04be2d /Objects/bytesobject.c
parent697e56d0f592165209cbeb87583c75dc231c6338 (diff)
downloadcpython-ace3ad3bf79a8a3b0ea9d1de97c8f8b59d1ac7b2.zip
cpython-ace3ad3bf79a8a3b0ea9d1de97c8f8b59d1ac7b2.tar.gz
cpython-ace3ad3bf79a8a3b0ea9d1de97c8f8b59d1ac7b2.tar.bz2
Issue #16975: Fix error handling bug in the escape-decode bytes decoder.
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index ef3a5a1..c0f5aff 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -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--;