From: Guido van Rossum Date: Mon, 12 Apr 1999 22:51:20 +0000 (+0000) Subject: Fix accidentally reversed NULL test in load_mark(). Suggested by X-Git-Tag: v1.5.2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=761fcd03aa71d16225850a797f6a7c67c12800ed;p=thirdparty%2FPython%2Fcpython.git Fix accidentally reversed NULL test in load_mark(). Suggested by Tamito Kajiyama. (This caused a bug only on platforms where malloc(0) returns NULL.) --- diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 614ff06c2595..a661c660b048 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -3295,7 +3295,7 @@ load_mark(Unpicklerobject *self) { if ((self->num_marks + 1) >= self->marks_size) { s=self->marks_size+20; if (s <= self->num_marks) s=self->num_marks + 1; - if (self->marks) + if (self->marks == NULL) self->marks=(int *)malloc(s * sizeof(int)); else self->marks=(int *)realloc(self->marks, s * sizeof(int));