Issue #14471: Fix a possible buffer overrun in the winreg module.

This commit is contained in:
Kristján Valur Jónsson 2012-04-02 15:23:29 +00:00
parent e900096dc4
commit 984dfa7eed
2 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,8 @@ Core and Builtins
- Issue #13521: dict.setdefault() now does only one lookup for the given key,
making it "atomic" for many purposes. Patch by Filip Gruszczyński.
- Issue #14471: Fix a possible buffer overrun in the winreg module.
Library
-------

View File

@ -1110,7 +1110,7 @@ PyEnumKey(PyObject *self, PyObject *args)
* nul. RegEnumKeyEx requires a 257 character buffer to
* retrieve such a key name. */
wchar_t tmpbuf[257];
DWORD len = sizeof(tmpbuf); /* includes NULL terminator */
DWORD len = sizeof(tmpbuf)/sizeof(wchar_t); /* includes NULL terminator */
if (!PyArg_ParseTuple(args, "Oi:EnumKey", &obKey, &index))
return NULL;