[Python-checkins] r70199 - python/branches/release25-maint/Objects/unicodeobject.c

guido.van.rossum python-checkins at python.org
Thu Mar 5 22:47:34 CET 2009


Author: guido.van.rossum
Date: Thu Mar  5 22:47:33 2009
New Revision: 70199

Log:
Avoid potential for undefined variable 'startinpos' in PyUnicode_DecodeUTF7().
See issue #5389.


Modified:
   python/branches/release25-maint/Objects/unicodeobject.c

Modified: python/branches/release25-maint/Objects/unicodeobject.c
==============================================================================
--- python/branches/release25-maint/Objects/unicodeobject.c	(original)
+++ python/branches/release25-maint/Objects/unicodeobject.c	Thu Mar  5 22:47:33 2009
@@ -1012,7 +1012,7 @@
                     }
                 } else if (SPECIAL(ch,0,0)) {
                     errmsg = "unexpected special character";
-	                goto utf7Error;
+	            goto utf7Error;
                 } else  {
                     *p++ = ch;
                 }
@@ -1036,9 +1036,10 @@
             }
         }
         else if (SPECIAL(ch,0,0)) {
+            startinpos = s-starts;
             errmsg = "unexpected special character";
             s++;
-	        goto utf7Error;
+            goto utf7Error;
         }
         else {
             *p++ = ch;


More information about the Python-checkins mailing list