(original) (raw)

changeset: 84537:9fb3656b178a parent: 84535:70f55dc9d43f parent: 84536:4343dfaca8e2 user: Christian Heimes christian@cheimes.de date: Thu Jul 11 11:23:34 2013 +0200 files: Misc/NEWS description: Issue #18426: Fix NULL pointer dereference in C extension import when PyModule_GetDef() returns an error. diff -r 70f55dc9d43f -r 9fb3656b178a Misc/NEWS --- a/Misc/NEWS Wed Jul 10 17:02:24 2013 -0400 +++ b/Misc/NEWS Thu Jul 11 11:23:34 2013 +0200 @@ -10,6 +10,9 @@ Core and Builtins ----------------- +- Issue #18426: Fix NULL pointer dereference in C extension import when + PyModule_GetDef() returns an error. + - Issue #17206: On Windows, increase the stack size from 2 MB to 4.2 MB to fix a stack overflow in the marshal module (fix a crash in test_marshal). Patch written by Jeremy Kloth. diff -r 70f55dc9d43f -r 9fb3656b178a Python/importdl.c --- a/Python/importdl.c Wed Jul 10 17:02:24 2013 -0400 +++ b/Python/importdl.c Thu Jul 11 11:23:34 2013 +0200 @@ -97,6 +97,8 @@ /* 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 */ /christian@cheimes.de