summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2019-03-20 11:53:08 (GMT)
committerGitHub <noreply@github.com>2019-03-20 11:53:08 (GMT)
commitcc60cdd9c44dd15e441603ee5f78e09ea3e76929 (patch)
treed8f03c88d586ca833df35edfd7994498061d5936 /PC
parentd5f18a63cc2dfe8d0adec8bce384a8c569b0f3dc (diff)
downloadcpython-cc60cdd9c44dd15e441603ee5f78e09ea3e76929.zip
cpython-cc60cdd9c44dd15e441603ee5f78e09ea3e76929.tar.gz
cpython-cc60cdd9c44dd15e441603ee5f78e09ea3e76929.tar.bz2
bpo-8677: use PY_DWORD_MAX instead of INT_MAX (GH-12469)
Diffstat (limited to 'PC')
-rw-r--r--PC/winreg.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 4dc4e0c..ae0c292 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -1605,13 +1605,11 @@ winreg_SetValue_impl(PyObject *module, HKEY key, const Py_UNICODE *sub_key,
long rc;
if (type != REG_SZ) {
- PyErr_SetString(PyExc_TypeError,
- "Type must be winreg.REG_SZ");
+ PyErr_SetString(PyExc_TypeError, "type must be winreg.REG_SZ");
return NULL;
}
- if (value_length >= INT_MAX) {
- PyErr_SetString(PyExc_OverflowError,
- "the value is too long");
+ if ((size_t)value_length >= PY_DWORD_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "value is too long");
return NULL;
}