Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 38662:1d239c7e8d60 2.4
Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking.
(backport from rev. 46741)
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Thu, 08 Jun 2006 12:45:05 +0000 |
| parents | 11744f7bb47a |
| children | e0d29586212a |
line wrap: on
line diff
--- a/Python/getargs.c Wed Jun 07 21:59:32 2006 +0000 +++ b/Python/getargs.c Thu Jun 08 12:45:05 2006 +0000 @@ -552,12 +552,12 @@ ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) return converterr("integer<i>", arg, msgbuf, bufsize); - else if (ival > INT_MAX) { + else if (ival > LONG_MAX) { PyErr_SetString(PyExc_OverflowError, "signed integer is greater than maximum"); return converterr("integer<i>", arg, msgbuf, bufsize); } - else if (ival < INT_MIN) { + else if (ival < LONG_MIN) { PyErr_SetString(PyExc_OverflowError, "signed integer is less than minimum"); return converterr("integer<i>", arg, msgbuf, bufsize);
