summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2012-04-02 15:23:29 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2012-04-02 15:23:29 (GMT)
commit984dfa7eed5a2c4673a5cc108f6bad1401e83440 (patch)
treef03bd023e56252c8428e013855c2ea9062edfdb9
parente900096dc42cd0d590752e00ba3983b4672da806 (diff)
downloadcpython-984dfa7eed5a2c4673a5cc108f6bad1401e83440.zip
cpython-984dfa7eed5a2c4673a5cc108f6bad1401e83440.tar.gz
cpython-984dfa7eed5a2c4673a5cc108f6bad1401e83440.tar.bz2
Issue #14471: Fix a possible buffer overrun in the winreg module.
-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 3d9b822..18a8d73 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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
-------
diff --git a/PC/winreg.c b/PC/winreg.c
index 1bc47b9..240ca69 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -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;