summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS2
-rw-r--r--Objects/moduleobject.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 1c58097856..2505bfa56a 100644
--- 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
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index ae01651297..7f81ce41bd 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -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);