diff Python/marshal.c @ 43536:cda0b625275a legacy-trunk

Fix Coverity 185-186: If the passed in FILE is NULL, uninitialized memory would be accessed. Will backport.
author Neal Norwitz <nnorwitz@gmail.com>
date Fri, 12 Oct 2007 03:05:19 +0000
parents 6f0dba807734
children da58cf9bcb01
line wrap: on
line diff
--- a/Python/marshal.c	Fri Oct 12 03:04:18 2007 +0000
+++ b/Python/marshal.c	Fri Oct 12 03:05:19 2007 +0000
@@ -1013,6 +1013,7 @@
 	RFILE rf;
 	rf.fp = fp;
 	rf.strings = NULL;
+	rf.ptr = rf.end = NULL;
 	return r_long(&rf);
 }
 
@@ -1086,6 +1087,7 @@
 	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;