From 55a6f73b49625ebff575521c3a0b919880f5f0ec Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 9 Sep 2019 07:25:20 -0700 Subject: [PATCH] bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766) (cherry picked from commit ef66f31ce21cd759cc0c618c5c42ba6da0a06834) Co-authored-by: Steve Dower --- PC/winreg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/winreg.c b/PC/winreg.c index 0016b320cac0..16a10c7232a1 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); -- 2.47.3