]> granicus.if.org Git - python/commitdiff
Issue #3740: Null-initialize module state.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 7 Oct 2008 13:16:28 +0000 (13:16 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 7 Oct 2008 13:16:28 +0000 (13:16 +0000)
Reviewed by Benjamin Peterson.

Misc/NEWS
Objects/moduleobject.c

index 1c580978563990732f3f7a59a19872045f6592e8..2505bfa56a7893b8740a89634ea16e3581fe1e1d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,6 +15,8 @@ What's New in Python 3.0 beta 5
 Core and Builtins
 -----------------
 
+- Issue #3740: Null-initialize module state.
+
 - Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
 
 - Issue #1688: On Windows, the input() prompt was not correctly displayed if it
index ae01651297a669b37615c8a9d6c3dda5e0263e5f..7f81ce41bd858c654fdc9c7ef176799a85d63b4d 100644 (file)
@@ -113,6 +113,7 @@ PyModule_Create2(struct PyModuleDef* module, int module_api_version)
                        Py_DECREF(m);
                        return NULL;
                }
+               memset(m->md_state, 0, module->m_size);
        }
                        
        d = PyModule_GetDict((PyObject*)m);