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

parent e900096d
...@@ -34,6 +34,8 @@ Core and Builtins ...@@ -34,6 +34,8 @@ Core and Builtins
- Issue #13521: dict.setdefault() now does only one lookup for the given key, - Issue #13521: dict.setdefault() now does only one lookup for the given key,
making it "atomic" for many purposes. Patch by Filip Gruszczyński. making it "atomic" for many purposes. Patch by Filip Gruszczyński.
- Issue #14471: Fix a possible buffer overrun in the winreg module.
Library Library
------- -------
......
...@@ -1110,7 +1110,7 @@ PyEnumKey(PyObject *self, PyObject *args) ...@@ -1110,7 +1110,7 @@ PyEnumKey(PyObject *self, PyObject *args)
* nul. RegEnumKeyEx requires a 257 character buffer to * nul. RegEnumKeyEx requires a 257 character buffer to
* retrieve such a key name. */ * retrieve such a key name. */
wchar_t tmpbuf[257]; 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)) if (!PyArg_ParseTuple(args, "Oi:EnumKey", &obKey, &index))
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment