Update of /cvsroot/vba/VisualBoyAdvance/src/sdl
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5171/src/sdl
Modified Files:
SDL.cpp
Log Message:
Applied patch [ 1264167 ] Buffer overflow patch by Quirky - richq
Index: SDL.cpp
===================================================================
RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/SDL.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** SDL.cpp 25 Aug 2006 13:59:54 -0000 1.17
--- SDL.cpp 25 Aug 2006 14:06:01 -0000 1.18
***************
*** 188,191 ****
--- 188,192 ----
#define REWIND_SIZE 400000
+ #define SYSMSG_BUFFER_SIZE 1024
#define _stricmp strcasecmp
***************
*** 2193,2196 ****
--- 2194,2203 ----
if(optind < argc) {
char *szFile = argv[optind];
+ u32 len = strlen(szFile);
+ if (len > SYSMSG_BUFFER_SIZE)
+ {
+ fprintf(stderr,"%s :%s: File name too long\n",argv[0],szFile);
+ exit(-1);
+ }
utilGetBaseName(szFile, filename);
***************
*** 2612,2616 ****
void systemMessage(int num, const char *msg, ...)
{
! char buffer[2048];
va_list valist;
--- 2619,2623 ----
void systemMessage(int num, const char *msg, ...)
{
! char buffer[SYSMSG_BUFFER_SIZE*2];
va_list valist;
|