summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-11-12 22:26:10 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-11-12 22:26:10 (GMT)
commitbf5ca65c2d34046dd8f2dfb89164f3e55f6a3396 (patch)
treebca0b2c2f96d2377385fda3274c266c16f448cd8 /Modules
parentf8197d4f9f09585896c2957f34a6d3fac3362190 (diff)
downloadcpython-bf5ca65c2d34046dd8f2dfb89164f3e55f6a3396.zip
cpython-bf5ca65c2d34046dd8f2dfb89164f3e55f6a3396.tar.gz
cpython-bf5ca65c2d34046dd8f2dfb89164f3e55f6a3396.tar.bz2
load_string(): Force use of unsigned compare in a context that was
clearly (but incorrectly) assuming it.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cPickle.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index f8a3c1c..54a1151 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -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)