mirror of
https://github.com/python/cpython.git
synced 2026-08-09 18:50:37 -04:00
Issue #18426: Fix NULL pointer dereference in C extension import when
PyModule_GetDef() returns an error.
This commit is contained in:
@@ -97,6 +97,8 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp)
|
||||
|
||||
/* Remember pointer to module init function. */
|
||||
def = PyModule_GetDef(m);
|
||||
if (def == NULL)
|
||||
goto error;
|
||||
def->m_base.m_init = p;
|
||||
|
||||
/* Remember the filename as the __file__ attribute */
|
||||
|
||||
Reference in New Issue
Block a user