summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-06-08 12:45:01 (GMT)
committerGeorg Brandl <georg@python.org>2006-06-08 12:45:01 (GMT)
commit22ccbbc4ecc410f5bca7ffc31c56d4badc2d2772 (patch)
treeda46dae853ee276857bf0cf3b29b2c1734eb6145
parent06c5c8a4d31b5b9c4846604c76028a926ebd1c21 (diff)
downloadcpython-22ccbbc4ecc410f5bca7ffc31c56d4badc2d2772.zip
cpython-22ccbbc4ecc410f5bca7ffc31c56d4badc2d2772.tar.gz
cpython-22ccbbc4ecc410f5bca7ffc31c56d4badc2d2772.tar.bz2
Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking.
-rw-r--r--Python/getargs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 1552790..727376d 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -624,12 +624,12 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
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);