mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Fix Coverity 185-186: If the passed in FILE is NULL, uninitialized memory
would be accessed. Will backport.
This commit is contained in:
parent
a7d329a9b2
commit
15f2661758
1 changed files with 2 additions and 0 deletions
|
@ -1013,6 +1013,7 @@ PyMarshal_ReadLongFromFile(FILE *fp)
|
||||||
RFILE rf;
|
RFILE rf;
|
||||||
rf.fp = fp;
|
rf.fp = fp;
|
||||||
rf.strings = NULL;
|
rf.strings = NULL;
|
||||||
|
rf.ptr = rf.end = NULL;
|
||||||
return r_long(&rf);
|
return r_long(&rf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1086,6 +1087,7 @@ PyMarshal_ReadObjectFromFile(FILE *fp)
|
||||||
rf.fp = fp;
|
rf.fp = fp;
|
||||||
rf.strings = PyList_New(0);
|
rf.strings = PyList_New(0);
|
||||||
rf.depth = 0;
|
rf.depth = 0;
|
||||||
|
rf.ptr = rf.end = NULL;
|
||||||
result = r_object(&rf);
|
result = r_object(&rf);
|
||||||
Py_DECREF(rf.strings);
|
Py_DECREF(rf.strings);
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue