[Python-checkins] CVS: python/dist/src/Python symtable.c,2.6,2.7

Barry Warsaw bwarsaw@users.sourceforge.net
2001年11月28日 13:36:30 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv27015
Modified Files:
	symtable.c 
Log Message:
ste_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer
overrun avoidance.
Index: symtable.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v
retrieving revision 2.6
retrieving revision 2.7
diff -C2 -d -r2.6 -r2.7
*** symtable.c	2001年09月20日 20:46:19	2.6
--- symtable.c	2001年11月28日 21:36:28	2.7
***************
*** 86,93 ****
 	char buf[256];
 
! 	sprintf(buf, "<symtable entry %.100s(%ld), line %d>",
! 		PyString_AS_STRING(ste->ste_name),
! 		PyInt_AS_LONG(ste->ste_id),
! 		ste->ste_lineno);
 	return PyString_FromString(buf);
 }
--- 86,94 ----
 	char buf[256];
 
! 	PyOS_snprintf(buf, sizeof(buf),
! 		 "<symtable entry %.100s(%ld), line %d>",
! 		 PyString_AS_STRING(ste->ste_name),
! 		 PyInt_AS_LONG(ste->ste_id),
! 		 ste->ste_lineno);
 	return PyString_FromString(buf);
 }

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