diff options
author | Brian Curtin <brian@python.org> | 2012-12-27 20:04:42 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-12-27 20:04:42 (GMT) |
commit | 172e42295fa846bb253f698da10150906f723f52 (patch) | |
tree | 0f5295694a80c6e3f70e8000983ecdadc5c5bc9a /PC/winreg.c | |
parent | 12706f20825f78afa8305c1cbeb47900a790c21a (diff) | |
download | cpython-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/winreg.c')
-rw-r--r-- | PC/winreg.c | 4 |
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: |