diff options
| author | Georg Brandl <georg@python.org> | 2006-06-08 12:45:05 (GMT) |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2006-06-08 12:45:05 (GMT) |
| commit | 78fbb2a032a45f9e6938a0b35afe673bfdd53f19 (patch) | |
| tree | a4d294a89307c053da640a17e9e1d4c51c568bb0 /Python | |
| parent | eac87370f8996d3ad6babcab0192fe74b6552175 (diff) | |
| download | cpython-78fbb2a032a45f9e6938a0b35afe673bfdd53f19.zip cpython-78fbb2a032a45f9e6938a0b35afe673bfdd53f19.tar.gz cpython-78fbb2a032a45f9e6938a0b35afe673bfdd53f19.tar.bz2 | |
Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking.
(backport from rev. 46741)
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/getargs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 2d231ce..be79b75 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -552,12 +552,12 @@ convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf, 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); |
