[Python-checkins] r46742 - python/branches/release24-maint/Python/getargs.c

georg.brandl python-checkins at python.org
Thu Jun 8 14:45:05 CEST 2006


Author: georg.brandl
Date: Thu Jun  8 14:45:05 2006
New Revision: 46742

Modified:
   python/branches/release24-maint/Python/getargs.c
Log:
Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds checking.
 (backport from rev. 46741)

Modified: python/branches/release24-maint/Python/getargs.c
==============================================================================
--- python/branches/release24-maint/Python/getargs.c	(original)
+++ python/branches/release24-maint/Python/getargs.c	Thu Jun  8 14:45:05 2006
@@ -552,12 +552,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