summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-11 11:23:34 +0200
committerChristian Heimes <christian@cheimes.de>2013-07-11 11:23:34 +0200
commit5ec44649dfc2f5ec7daddcf33075b4b26b2e63d1 (patch)
treec33561e3df3e01245dc04b72adf2c29e3f0ada3a /Python
parent16dbbae2981c96c7c9b1ae81e1708d54b08c10ac (diff)
parent848ee099f5b36650fa7c23ec91110f319e40fd13 (diff)
downloadcpython-git-5ec44649dfc2f5ec7daddcf33075b4b26b2e63d1.tar.gz
Issue #18426: Fix NULL pointer dereference in C extension import when
PyModule_GetDef() returns an error.
Diffstat (limited to 'Python')
-rw-r--r--Python/importdl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 942e4b8d28..e393de153b 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -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 */