Skip to content

Commit ef66f31

Browse files
zoobajaraco
authored andcommitted
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
1 parent 992347d commit ef66f31

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)