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

Skip to content

Commit 2247775

Browse files
author
Kristján Valur Jónsson
committed
Merge with 3.2 (Issue #14471)
2 parents dba1b40 + 984dfa7 commit 2247775

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
@@ -56,6 +56,8 @@ Core and Builtins
5656
- Issue #14435: Remove dedicated block allocator from floatobject.c and rely
5757
on the PyObject_Malloc() api like all other objects.
5858

59+
- Issue #14471: Fix a possible buffer overrun in the winreg module.
60+
5961
Library
6062
-------
6163

PC/winreg.c

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

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

0 commit comments

Comments
 (0)