diff options
author | Kristj?n Valur J?nsson <kristjan@ccpgames.com> | 2012-04-02 15:23:29 +0000 |
---|---|---|
committer | Kristj?n Valur J?nsson <kristjan@ccpgames.com> | 2012-04-02 15:23:29 +0000 |
commit | 339db421f6ea43ff2fcfcedf2adf143975da781a (patch) | |
tree | 33f50d353249bd17b7690abec7130878caa46e5e | |
parent | 3f6d1484cc819dc6f879aaac59c6100bf30e4b64 (diff) | |
download | cpython-339db421f6ea43ff2fcfcedf2adf143975da781a.tar.gz |
Issue #14471: Fix a possible buffer overrun in the winreg module.
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | PC/winreg.c | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -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 1bc47b958b..240ca69c39 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; |