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

Skip to content

Commit 984dfa7

Browse files
author
Kristján Valur Jónsson
committed
Issue #14471: Fix a possible buffer overrun in the winreg module.
1 parent e900096 commit 984dfa7

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Core and Builtins
3434
- Issue #13521: dict.setdefault() now does only one lookup for the given key,
3535
making it "atomic" for many purposes. Patch by Filip Gruszczyński.
3636

37+
- Issue #14471: Fix a possible buffer overrun in the winreg module.
38+
3739
Library
3840
-------
3941

PC/winreg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ PyEnumKey(PyObject *self, PyObject *args)
11101110
* nul. RegEnumKeyEx requires a 257 character buffer to
11111111
* retrieve such a key name. */
11121112
wchar_t tmpbuf[257];
1113-
DWORD len = sizeof(tmpbuf); /* includes NULL terminator */
1113+
DWORD len = sizeof(tmpbuf)/sizeof(wchar_t); /* includes NULL terminator */
11141114

11151115
if (!PyArg_ParseTuple(args, "Oi:EnumKey", &obKey, &index))
11161116
return NULL;

0 commit comments

Comments
 (0)