mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +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
|
|
@ -1746,14 +1746,13 @@ builtin_raw_input(PyObject *self, PyObject *args)
|
|||
}
|
||||
else { /* strip trailing '\n' */
|
||||
size_t len = strlen(s);
|
||||
if (len > INT_MAX) {
|
||||
if (len > PY_SSIZE_T_MAX) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"[raw_]input: input too long");
|
||||
result = NULL;
|
||||
}
|
||||
else {
|
||||
result = PyString_FromStringAndSize(s,
|
||||
(int)(len-1));
|
||||
result = PyString_FromStringAndSize(s, len-1);
|
||||
}
|
||||
}
|
||||
PyMem_FREE(s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue