summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2012-04-02 15:41:06 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2012-04-02 15:41:06 (GMT)
commit2247775bfa38f27aa3b36b7740cf2cec98356235 (patch)
tree134572c5ae96bf41ae22c0a7b2a47820e775f447
parentdba1b40b6064107d63f228fe67a258dd1123b189 (diff)
parent984dfa7eed5a2c4673a5cc108f6bad1401e83440 (diff)
downloadcpython-2247775bfa38f27aa3b36b7740cf2cec98356235.zip
cpython-2247775bfa38f27aa3b36b7740cf2cec98356235.tar.gz
cpython-2247775bfa38f27aa3b36b7740cf2cec98356235.tar.bz2
Merge with 3.2 (Issue #14471)
-rw-r--r--Misc/NEWS2
-rw-r--r--PC/winreg.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 8f66178..2a05802 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,6 +56,8 @@ Core and Builtins
- Issue #14435: Remove dedicated block allocator from floatobject.c and rely
on the PyObject_Malloc() api like all other objects.
+- Issue #14471: Fix a possible buffer overrun in the winreg module.
+
Library
-------
diff --git a/PC/winreg.c b/PC/winreg.c
index 451ced2..3a5c8a6 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -1122,7 +1122,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;