summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-06-08 13:31:07 (GMT)
committerGeorg Brandl <georg@python.org>2006-06-08 13:31:07 (GMT)
commit98251f8a2f169d5fd1b6ae0fc9c020d00ec74df5 (patch)
treef8866400f0bfe7dbe2fca5607d730e06808eaa48
parentc9ae4e8a2dbe29f1878f9acad411d5a64407fb76 (diff)
downloadcpython-98251f8a2f169d5fd1b6ae0fc9c020d00ec74df5.zip
cpython-98251f8a2f169d5fd1b6ae0fc9c020d00ec74df5.tar.gz
cpython-98251f8a2f169d5fd1b6ae0fc9c020d00ec74df5.tar.bz2
Argh. "integer" is a very confusing word ;)
Actually, checking for INT_MAX and INT_MIN is correct since the format code explicitly handles a C "int".
-rw-r--r--Misc/NEWS3
-rw-r--r--Python/getargs.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 19664a2..d54806a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -213,9 +213,6 @@ What's New in Python 2.5 alpha 2?
Core and builtins
-----------------
-- Bug #1502750: Check bounds integer arguments correctly on 64-bit
- platforms.
-
- Bug #1465834: 'bdist_wininst preinstall script support' was fixed
by converting these apis from macros into exported functions again:
diff --git a/Python/getargs.c b/Python/getargs.c
index 727376d..1552790 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 > LONG_MAX) {
+ else if (ival > INT_MAX) {
PyErr_SetString(PyExc_OverflowError,
"signed integer is greater than maximum");
return converterr("integer<i>", arg, msgbuf, bufsize);
}
- else if (ival < LONG_MIN) {
+ else if (ival < INT_MIN) {
PyErr_SetString(PyExc_OverflowError,
"signed integer is less than minimum");
return converterr("integer<i>", arg, msgbuf, bufsize);