summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-10-12 03:05:19 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2007-10-12 03:05:19 +0000
commit64182dfdd27d85672b765e0a0d9b860f81ea84ba (patch)
tree9f1a696d38fd3f91f2b4c82e339789c6a15772b8 /Python/marshal.c
parent305472e7705d711156b0320cd6188c1c060e13ff (diff)
downloadcpython-64182dfdd27d85672b765e0a0d9b860f81ea84ba.tar.gz
Fix Coverity 185-186: If the passed in FILE is NULL, uninitialized memory
would be accessed. Will backport.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index eac4616cc5..897c15ec8a 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1013,6 +1013,7 @@ PyMarshal_ReadLongFromFile(FILE *fp)
RFILE rf;
rf.fp = fp;
rf.strings = NULL;
+ rf.ptr = rf.end = NULL;
return r_long(&rf);
}
@@ -1086,6 +1087,7 @@ PyMarshal_ReadObjectFromFile(FILE *fp)
rf.fp = fp;
rf.strings = PyList_New(0);
rf.depth = 0;
+ rf.ptr = rf.end = NULL;
result = r_object(&rf);
Py_DECREF(rf.strings);
return result;