mirror of
https://github.com/python/cpython.git
synced 2025-10-18 12:48:57 +00:00
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.
This commit is contained in:
parent
7fd173bfc4
commit
422210426e
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue