]> granicus.if.org Git - python/commitdiff
load_string(): Force use of unsigned compare in a context that was
authorTim Peters <tim.peters@gmail.com>
Mon, 12 Nov 2001 22:26:10 +0000 (22:26 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 12 Nov 2001 22:26:10 +0000 (22:26 +0000)
clearly (but incorrectly) assuming it.

Modules/cPickle.c

index f8a3c1c0f61f9dff8405c6327f2d9784b2e9756f..54a115172f6ffc7de992fe21ecd6c7d35d3c2685 100644 (file)
@@ -2821,12 +2821,14 @@ load_string(Unpicklerobject *self) {
         if (*p==q && nslash%2==0) break;
         if (*p=='\\') nslash++;
         else nslash=0;
-      }
-    if (*p==q)
-      {
-        for (p++; *p; p++) if (*p > ' ') goto insecure;
-      }
-    else goto insecure;
+    }
+    if (*p == q) {
+        for (p++; *p; p++)
+            if (*(unsigned char *)p > ' ')
+                goto insecure;
+    }
+    else
+        goto insecure;
     /********************************************/
 
     UNLESS (eval_dict)