mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
bpo-8677: use PY_DWORD_MAX instead of INT_MAX (GH-12469)
This commit is contained in:
parent
d5f18a63cc
commit
cc60cdd9c4
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user