summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2012-12-27 20:04:42 (GMT)
committerBrian Curtin <brian@python.org>2012-12-27 20:04:42 (GMT)
commit172e42295fa846bb253f698da10150906f723f52 (patch)
tree0f5295694a80c6e3f70e8000983ecdadc5c5bc9a /PC
parent12706f20825f78afa8305c1cbeb47900a790c21a (diff)
downloadcpython-172e42295fa846bb253f698da10150906f723f52.zip
cpython-172e42295fa846bb253f698da10150906f723f52.tar.gz
cpython-172e42295fa846bb253f698da10150906f723f52.tar.bz2
Fix #16759. Convert DWORD registry values using PyLong_FromUnsignedLong.
When converting REG_DWORD registry values into Python ints, the conversion needs to be made from an *unsigned* long to match the DWORD type.
Diffstat (limited to 'PC')
-rw-r--r--PC/winreg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 523ad17..e4b9307 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -900,9 +900,9 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
switch (typ) {
case REG_DWORD:
if (retDataSize == 0)
- obData = PyLong_FromLong(0);
+ obData = PyLong_FromUnsignedLong(0);
else
- obData = PyLong_FromLong(*(int *)retDataBuf);
+ obData = PyLong_FromUnsignedLong(*(int *)retDataBuf);
break;
case REG_SZ:
case REG_EXPAND_SZ: