Skip to content

Commit 55a6f73

Browse files
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
(cherry picked from commit ef66f31) Co-authored-by: Steve Dower <[email protected]>
1 parent 472f37a commit 55a6f73

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)