Skip to content

Commit 7789adb

Browse files
zoobawebsurfer5
authored andcommitted
bpo-32587: Fixes unsafe downcast in PC/winreg.c (pythonGH-15766)
1 parent 4fd9a27 commit 7789adb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PC/winreg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
772772
return NULL;
773773
}
774774
PyList_SET_ITEM(obData, index, uni);
775-
len -= slen + 1;
775+
len -= Py_SAFE_DOWNCAST(slen + 1, size_t, int);
776776
}
777777
PyMem_Free(str);
778778

0 commit comments

Comments
 (0)