From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 9 Sep 2019 14:23:37 +0000 (-0700) Subject: bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766) X-Git-Tag: v3.8.0rc1~257 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44729c9f5198211faf533da49fa0fa26693a1993;p=python bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766) (cherry picked from commit ef66f31ce21cd759cc0c618c5c42ba6da0a06834) Co-authored-by: Steve Dower --- diff --git a/PC/winreg.c b/PC/winreg.c index 37bc2c72dc..72a7c380be 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -772,7 +772,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ) return NULL; } PyList_SET_ITEM(obData, index, uni); - len -= slen + 1; + len -= Py_SAFE_DOWNCAST(slen + 1, size_t, int); } PyMem_Free(str);