diff Objects/stringobject.c @ 81737:5970c90dd8d1 2.7

Issue #16975: Fix error handling bug in the escape-decode decoder.
author Serhiy Storchaka <storchaka@gmail.com>
date Fri, 25 Jan 2013 23:30:50 +0200
parents ee93a89b4e0f
children 4d120cea3507
line wrap: on
line diff
--- a/Objects/stringobject.c	Fri Jan 25 17:55:39 2013 +0100
+++ b/Objects/stringobject.c	Fri Jan 25 23:30:50 2013 +0200
@@ -726,6 +726,10 @@
                              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':