New submission from Ivan Johansen:

In Python/importdl.c around line 99 in the function 
_PyImport_LoadDynamicModule() you can find the code:
  def = PyModule_GetDef(m);
  def->m_base.m_init = p;

If the module m, which is returned from a newly imported extension, is not 
created by PyModule_Create() but in some other way then PyModule_GetDef(m) will 
return NULL. The next line will then dereference a NULL pointer and crash. 

I suggest a check for this is added:
  def = PyModule_GetDef(m);
  if(def != NULL) 
    def->m_base.m_init = p;

----------
messages: 192845
nosy: Padowan
priority: normal
severity: normal
status: open
title: Crash when extension does not use PyModule_Create()
type: crash
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18426>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to