summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2012-12-27 16:12:45 (GMT)
committerBrian Curtin <brian@python.org>2012-12-27 16:12:45 (GMT)
commit12706f20825f78afa8305c1cbeb47900a790c21a (patch)
tree5dc796bba028f94b3072eb279602abdf54dc47b0 /PC
parente26568f81244e3fb62ab07fd0a3405a99ee87895 (diff)
downloadcpython-12706f20825f78afa8305c1cbeb47900a790c21a.zip
cpython-12706f20825f78afa8305c1cbeb47900a790c21a.tar.gz
cpython-12706f20825f78afa8305c1cbeb47900a790c21a.tar.bz2
Fix #14420. Use PyLong_AsUnsignedLong to support the full range of DWORD.
This fixes an OverflowError seen in winreg.SetValueEx when passed winreg.REG_DWORD values that should be supported by the underlying API.
Diffstat (limited to 'PC')
-rw-r--r--PC/winreg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 454ea53..523ad17 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -785,7 +785,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
memcpy(*retDataBuf, &zero, sizeof(DWORD));
}
else {
- DWORD d = PyLong_AsLong(value);
+ DWORD d = PyLong_AsUnsignedLong(value);
memcpy(*retDataBuf, &d, sizeof(DWORD));
}
break;