[Python-checkins] CVS: python/dist/src/Python traceback.c,2.34,2.35

Tim Peters tim_one@users.sourceforge.net
2001年11月27日 12:30:45 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv26953/python/Python
Modified Files:
	traceback.c 
Log Message:
SF bug 485175: buffer overflow in traceback.c.
Bugfix candidate.
tb_displayline(): the sprintf format was choking off the file name, but
used plain %s for the function name (which can be arbitrarily long).
Limit both to 500 chars max.
Index: traceback.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/traceback.c,v
retrieving revision 2.34
retrieving revision 2.35
diff -C2 -d -r2.34 -r2.35
*** traceback.c	2001年10月22日 22:17:41	2.34
--- traceback.c	2001年11月27日 20:30:42	2.35
***************
*** 145,149 ****
 	int err = 0;
 	FILE *xfp;
! 	char linebuf[1000];
 	int i;
 	if (filename == NULL || name == NULL)
--- 145,149 ----
 	int err = 0;
 	FILE *xfp;
! 	char linebuf[2000];
 	int i;
 	if (filename == NULL || name == NULL)
***************
*** 151,158 ****
 #ifdef MPW
 	/* This is needed by MPW's File and Line commands */
! #define FMT " File \"%.900s\"; line %d # in %s\n"
 #else
 	/* This is needed by Emacs' compile command */
! #define FMT " File \"%.900s\", line %d, in %s\n"
 #endif
 	xfp = fopen(filename, "r");
--- 151,158 ----
 #ifdef MPW
 	/* This is needed by MPW's File and Line commands */
! #define FMT " File \"%.500s\"; line %d # in %.500s\n"
 #else
 	/* This is needed by Emacs' compile command */
! #define FMT " File \"%.500s\", line %d, in %.500s\n"
 #endif
 	xfp = fopen(filename, "r");

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