Alexander Belopolsky added the comment:

+#define xx_state_global 
+       ((xxstate *)PyModule_GetState(PyState_FindModule(&xxmodule)))

This is unsafe: PyState_FindModule(&xxmodule) can return NULL.  I think code 
should account for this possibility and not use this macro.  For example, 
XxoObject_Check(v) should be defined as

(PyState_FindModule(&xxmodule) == NULL ? 0 : \
  (Py_TYPE(v) == xx_state(PyState_FindModule(&xxmodule))->Xxo_Type))

(Should this also check PyModule_GetState() return?)

----------

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

Reply via email to