Unverified Kaydet (Commit) cc60cdd9 authored tarafından Inada Naoki's avatar Inada Naoki Kaydeden (comit) GitHub

bpo-8677: use PY_DWORD_MAX instead of INT_MAX (GH-12469)

üst d5f18a63
...@@ -1605,13 +1605,11 @@ winreg_SetValue_impl(PyObject *module, HKEY key, const Py_UNICODE *sub_key, ...@@ -1605,13 +1605,11 @@ winreg_SetValue_impl(PyObject *module, HKEY key, const Py_UNICODE *sub_key,
long rc; long rc;
if (type != REG_SZ) { if (type != REG_SZ) {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError, "type must be winreg.REG_SZ");
"Type must be winreg.REG_SZ");
return NULL; return NULL;
} }
if (value_length >= INT_MAX) { if ((size_t)value_length >= PY_DWORD_MAX) {
PyErr_SetString(PyExc_OverflowError, PyErr_SetString(PyExc_OverflowError, "value is too long");
"the value is too long");
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment