changeset 30596:8806ec11a250

Use snprintf to ensure we do not write outside the buffer bounds when recording stub names into export_names.
author reimar
date Thu, 18 Feb 2010 20:20:23 +0000
parents 82e4e386fdc5
children 0dbb798e67b0
files loader/win32.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/loader/win32.c	Thu Feb 18 10:32:00 2010 +0000
+++ b/loader/win32.c	Thu Feb 18 20:20:23 2010 +0000
@@ -5516,7 +5516,7 @@
 
 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 @@
 
 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();
 }