From: Cesar S. <cst...@us...> - 2010-01-15 16:28:29
|
Update of /cvsroot/mingw/msys/rt/src/winsup/cygwin In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9242 Modified Files: ChangeLog.MSYS ismsys.cc Log Message: Add sanity checks to avoid possible crash. * ismsys.cc (GetFileDataStr): null-terminate the return data. (IsMsys): Bound-check the pointer passed to strcmp. Index: ismsys.cc =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ismsys.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ismsys.cc 28 Dec 2009 22:07:32 -0000 1.5 --- ismsys.cc 15 Jan 2010 16:28:10 -0000 1.6 *************** *** 67,71 **** { TRACE_IN; ! char *FileData = new char [bytes2get]; unsigned bytesread; --- 67,71 ---- { TRACE_IN; ! char *FileData = new char [bytes2get+1]; unsigned bytesread; *************** *** 83,86 **** --- 83,88 ---- } + FileData[bytes2get] = 0; + return FileData; } *************** *** 141,144 **** --- 143,152 ---- for (int I=0; impdata[I].name; I++) { + if (impdata[I].name < PE_ImportRva || + impdata[I].name - PE_ImportRva >= PE_ImportDataSz) + { + debug_printf("Unrecognized PE format"); + break; + } if (!strcmp((char *) PE_Import + impdata[I].name - PE_ImportRva, "msys-1.0.dll")) Index: ChangeLog.MSYS =================================================================== RCS file: /cvsroot/mingw/msys/rt/src/winsup/cygwin/ChangeLog.MSYS,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** ChangeLog.MSYS 15 Jan 2010 16:14:52 -0000 1.104 --- ChangeLog.MSYS 15 Jan 2010 16:28:10 -0000 1.105 *************** *** 1,4 **** --- 1,10 ---- 2010.01.15 Cesar Strauss <ces...@gm...> + Add sanity checks to avoid possible crash. + * ismsys.cc (GetFileDataStr): null-terminate the return data. + (IsMsys): Bound-check the pointer passed to strcmp. + + 2010.01.15 Cesar Strauss <ces...@gm...> + * include/cygwin/version.h: Increment version to 1.0.13. |