summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-09 14:25:20 (GMT)
committerGitHub <noreply@github.com>2019-09-09 14:25:20 (GMT)
commit55a6f73b49625ebff575521c3a0b919880f5f0ec (patch)
treecffa021fcae4931d04b016432e5ed20cb9139182
parent472f37ab9a33050d7d50d1ebe33ba324a51c52c2 (diff)
downloadcpython-55a6f73b49625ebff575521c3a0b919880f5f0ec.zip
cpython-55a6f73b49625ebff575521c3a0b919880f5f0ec.tar.gz
cpython-55a6f73b49625ebff575521c3a0b919880f5f0ec.tar.bz2
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
(cherry picked from commit ef66f31ce21cd759cc0c618c5c42ba6da0a06834) Co-authored-by: Steve Dower <steve.dower@python.org>
-rw-r--r--PC/winreg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 0016b32..16a10c7 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);