mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
12706f2082
commit
172e42295f
3 changed files with 23 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue