summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:30:50 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:30:50 (GMT)
commit01b3a08f5ee6f1ffa4ab52e2e9ecd43e0b56bdd9 (patch)
treeb6bd4be495565dd2a40c2d0159e071abd13ef2a0 /Objects/stringobject.c
parent1c60c7ac4cba9b947696f795dc16c8761f6bce38 (diff)
downloadcpython-01b3a08f5ee6f1ffa4ab52e2e9ecd43e0b56bdd9.zip
cpython-01b3a08f5ee6f1ffa4ab52e2e9ecd43e0b56bdd9.tar.gz
cpython-01b3a08f5ee6f1ffa4ab52e2e9ecd43e0b56bdd9.tar.bz2
Issue #16975: Fix error handling bug in the escape-decode decoder.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index b9809a2..0664142 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -726,6 +726,10 @@ PyObject *PyString_DecodeEscape(const char *s,
errors);
goto failed;
}
+ /* skip \x */
+ if (s < end && isxdigit(Py_CHARMASK(s[0])))
+ s++; /* and a hexdigit */
+ break;
#ifndef Py_USING_UNICODE
case 'u':
case 'U':