Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 38661:3581d1dc4253 legacy-trunk
Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Thu, 08 Jun 2006 12:45:01 +0000 |
| parents | 6eb86a71f5c8 |
| children | e2ba5ae4b813 |
line wrap: on
line diff
--- a/Python/getargs.c Thu Jun 08 11:56:44 2006 +0000 +++ b/Python/getargs.c Thu Jun 08 12:45:01 2006 +0000 @@ -624,12 +624,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);
