mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
Replace INT_MAX with PY_SSIZE_T_MAX.
This commit is contained in:
parent
2a19074a9c
commit
b1ed7fac12
5 changed files with 11 additions and 12 deletions
|
|
@ -56,12 +56,12 @@ PyObject *normalizestring(const char *string)
|
|||
char *p;
|
||||
PyObject *v;
|
||||
|
||||
if (len > INT_MAX) {
|
||||
PyErr_SetString(PyExc_OverflowError, "string is too large");
|
||||
return NULL;
|
||||
}
|
||||
if (len > PY_SSIZE_T_MAX) {
|
||||
PyErr_SetString(PyExc_OverflowError, "string is too large");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v = PyString_FromStringAndSize(NULL, (int)len);
|
||||
v = PyString_FromStringAndSize(NULL, len);
|
||||
if (v == NULL)
|
||||
return NULL;
|
||||
p = PyString_AS_STRING(v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue