Message304346
The following code crashes:
import zipimport
zi = zipimport.zipimporter.__new__(zipimport.zipimporter)
zi.find_module('foo')
This is because get_module_info() (in Modules/zipimport.c) assumes that the
zipimporter object is initialized, so it assumes that `self->prefix` is not
NULL, and passes it to make_filename(), which crashes.
get_module_code() makes the same assumption, and zipimport_zipimporter_get_data_impl()
assumes that `self->archive` is not NULL, and passes it to PyUnicode_GET_LENGTH(),
which crashes.
Thus, every method of an uninitialized zipimporter object might crash.
I would open a PR to fix this soon. |
|
Date |
User |
Action |
Args |
2017-10-13 16:56:47 | Oren Milman | set | recipients:
+ Oren Milman |
2017-10-13 16:56:47 | Oren Milman | set | messageid: <1507913807.6.0.213398074469.issue31781@psf.upfronthosting.co.za> |
2017-10-13 16:56:47 | Oren Milman | link | issue31781 messages |
2017-10-13 16:56:47 | Oren Milman | create | |
|