Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e0630c

Browse files
committed
Issue #3740: Null-initialize module state.
Reviewed by Benjamin Peterson.
1 parent 651423c commit 4e0630c

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ What's New in Python 3.0 beta 5
1515
Core and Builtins
1616
-----------------
1717

18+
- Issue #3740: Null-initialize module state.
19+
1820
- Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
1921

2022
- Issue #1688: On Windows, the input() prompt was not correctly displayed if it

Objects/moduleobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ PyModule_Create2(struct PyModuleDef* module, int module_api_version)
113113
Py_DECREF(m);
114114
return NULL;
115115
}
116+
memset(m->md_state, 0, module->m_size);
116117
}
117118

118119
d = PyModule_GetDict((PyObject*)m);

0 commit comments

Comments
 (0)