summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-10-12 03:59:09 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2007-10-12 03:59:09 +0000
commit163048ed12c9fdc5738cc7b3f903ecd0749b1d61 (patch)
treee5ebf1828752ee3d363211d933fd8e0fd517ed09 /Python
parent7d9c00ec4f8f8347c91fd60ae4eab032e385234b (diff)
downloadcpython-git-163048ed12c9fdc5738cc7b3f903ecd0749b1d61.tar.gz
Backport 58424:
Fix Coverity 185-186: If the passed in FILE is NULL, uninitialized memory would be accessed.
Diffstat (limited to 'Python')
-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;