[MPlayer-cvslog] r30638 - trunk/loader/win32.c

reimar subversion at mplayerhq.hu
Thu Feb 18 21:20:23 CET 2010


Author: reimar
Date: Thu Feb 18 21:20:23 2010
New Revision: 30638

Log:
Use snprintf to ensure we do not write outside the buffer bounds
when recording stub names into export_names.

Modified:
   trunk/loader/win32.c

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	Thu Feb 18 11:32:00 2010	(r30637)
+++ trunk/loader/win32.c	Thu Feb 18 21:20:23 2010	(r30638)
@@ -5516,7 +5516,7 @@ void* LookupExternal(const char* library
 
 no_dll:
     if(pos>150)return 0;
-    sprintf(export_names[pos], "%s:%d", library, ordinal);
+    snprintf(export_names[pos], sizeof(export_names[pos]), "%s:%d", library, ordinal);
     return add_stub();
 }
 
@@ -5583,7 +5583,7 @@ void* LookupExternalByName(const char* l
 
 no_dll_byname:
     if(pos>150)return 0;// to many symbols
-    strcpy(export_names[pos], name);
+    snprintf(export_names[pos], sizeof(export_names[pos]), "%s", name);
     return add_stub();
 }
 


More information about the MPlayer-cvslog mailing list