From 22ccbbc4ecc410f5bca7ffc31c56d4badc2d2772 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 8 Jun 2006 12:45:01 +0000 Subject: Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking. --- Python/getargs.c | 4 ++-- 1 file 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", 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", 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", arg, msgbuf, bufsize); -- cgit v0.12