bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)

(cherry picked from commit ef66f31ce2)

Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
Miss Islington (bot) 2019-09-09 07:23:37 -07:00 committed by GitHub
parent 5d695b6b7b
commit 44729c9f51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);