summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-12-01 02:52:56 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-12-01 02:52:56 (GMT)
commit422210426e6d0ac29389c66a82036bde123d8075 (patch)
tree42dd3875d16839e95912fd501988c23f3b6b920e /Objects
parent7fd173bfc42e30a2a097496fc10539c1c3893d82 (diff)
downloadcpython-422210426e6d0ac29389c66a82036bde123d8075.zip
cpython-422210426e6d0ac29389c66a82036bde123d8075.tar.gz
cpython-422210426e6d0ac29389c66a82036bde123d8075.tar.bz2
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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/intobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index aba9f51..46c3a09 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);
}