[Python-checkins] r46741 - python/trunk/Python/getargs.c
georg.brandl
python-checkins at python.org
Thu Jun 8 14:45:02 CEST 2006
Author: georg.brandl
Date: Thu Jun 8 14:45:01 2006
New Revision: 46741
Modified:
python/trunk/Python/getargs.c
Log:
Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking.
Modified: python/trunk/Python/getargs.c
==============================================================================
--- python/trunk/Python/getargs.c (original)
+++ python/trunk/Python/getargs.c Thu Jun 8 14:45:01 2006
@@ -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);
More information about the Python-checkins
mailing list