[Python-checkins] CVS: python/dist/src/Objects intobject.c,2.77,2.78

Tim Peters tim_one@users.sourceforge.net
2001年11月30日 18:52:59 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv12272/python/Objects
Modified Files:
	intobject.c 
Log Message:
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.
Index: intobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v
retrieving revision 2.77
retrieving revision 2.78
diff -C2 -d -r2.77 -r2.78
*** intobject.c	2001年11月28日 20:55:34	2.77
--- intobject.c	2001年12月01日 02:52:56	2.78
***************
*** 259,263 ****
 int_repr(PyIntObject *v)
 {
! 	char buf[20];
 	PyOS_snprintf(buf, sizeof(buf), "%ld", v->ob_ival);
 	return PyString_FromString(buf);
--- 259,263 ----
 int_repr(PyIntObject *v)
 {
! 	char buf[64];
 	PyOS_snprintf(buf, sizeof(buf), "%ld", v->ob_ival);
 	return PyString_FromString(buf);

AltStyle によって変換されたページ (->オリジナル) /