From: Tim Peters Date: Sat, 1 Dec 2001 02:52:56 +0000 (+0000) Subject: SF bug #487743: test_builtin fails on 64 bit platform. X-Git-Tag: v2.2.1c1~628 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=422210426e6d0ac29389c66a82036bde123d8075;p=python SF bug #487743: test_builtin fails on 64 bit platform. 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. --- diff --git a/Objects/intobject.c b/Objects/intobject.c index aba9f51283..46c3a09832 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -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); }