]> granicus.if.org Git - python/commitdiff
SF bug #487743: test_builtin fails on 64 bit platform.
authorTim Peters <tim.peters@gmail.com>
Sat, 1 Dec 2001 02:52:56 +0000 (02:52 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 1 Dec 2001 02:52:56 +0000 (02:52 +0000)
Bugfix candidate.
int_repr():  we've never had a buffer big enough to hold the largest
possible result on a 64-bit box.  Now that we're using snprintf instead
of sprintf, this can lead to nonsense results instead of random stack
corruption.

Objects/intobject.c

index aba9f512836c6bf60512f8a4b0ccbba81a9d84fb..46c3a09832a794c4ed4abeaed597136ee095a5f0 100644 (file)
@@ -258,7 +258,7 @@ int_print(PyIntObject *v, FILE *fp, int flags)
 static PyObject *
 int_repr(PyIntObject *v)
 {
-       char buf[20];
+       char buf[64];
        PyOS_snprintf(buf, sizeof(buf), "%ld", v->ob_ival);
        return PyString_FromString(buf);
 }