summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-10-07 13:16:28 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-10-07 13:16:28 (GMT)
commit4e0630cb5276512541e75bc6f4dd63f7fda9bee3 (patch)
tree5652ce13624dca0f32e1b72828aa0fef35a5b434
parent651423c1eb91a7e5a0ff346d2f52a654b765344a (diff)
downloadcpython-4e0630cb5276512541e75bc6f4dd63f7fda9bee3.zip
cpython-4e0630cb5276512541e75bc6f4dd63f7fda9bee3.tar.gz
cpython-4e0630cb5276512541e75bc6f4dd63f7fda9bee3.tar.bz2
Issue #3740: Null-initialize module state.
Reviewed by Benjamin Peterson.
-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 1c58097..2505bfa 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 ae01651..7f81ce4 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);