mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #19428: Handle PyMarshal_Read*() errors in run_pyc_file()
Detect also earlier PyMarshal_Read*() errors in zipimport.
This commit is contained in:
parent
50931f41d0
commit
5200f55024
2 changed files with 9 additions and 2 deletions
|
@ -939,6 +939,9 @@ read_directory(PyObject *archive)
|
|||
header_size = name_size +
|
||||
PyMarshal_ReadShortFromFile(fp) +
|
||||
PyMarshal_ReadShortFromFile(fp);
|
||||
if (PyErr_Occurred())
|
||||
goto error;
|
||||
|
||||
if (fread(dummy, 1, 8, fp) != 8) /* Skip unused fields, avoid fseek */
|
||||
goto file_error;
|
||||
file_offset = PyMarshal_ReadLongFromFile(fp) + arc_offset;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue