summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:32:41 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:32:41 (GMT)
commite58785b200241bc9ced51a30bce7781a3c0c629c (patch)
treedd8e2fb8d56d6b503b9bb060081851d20f1239ce /Objects/bytesobject.c
parenta10e4a9afbb95e74657455b6fb07a81fce948a3b (diff)
parentace3ad3bf79a8a3b0ea9d1de97c8f8b59d1ac7b2 (diff)
downloadcpython-e58785b200241bc9ced51a30bce7781a3c0c629c.zip
cpython-e58785b200241bc9ced51a30bce7781a3c0c629c.tar.gz
cpython-e58785b200241bc9ced51a30bce7781a3c0c629c.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 52db15d..bb9c6fb 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -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--;