Bug 2892: wcmd uses unsafe vsprintf

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug 2892: wcmd uses unsafe vsprintf

basic-3
as requested in bug 2892
http://bugs.winehq.org/show_bug.cgi?id=2892

here's a patch for wcmd to use vsnprintf rather than vsprintf.

--
basic

Index: programs/wcmd/wcmdmain.c
===================================================================
RCS file: /home/wine/wine/programs/wcmd/wcmdmain.c,v
retrieving revision 1.43
diff -u -r1.43 wcmdmain.c
--- programs/wcmd/wcmdmain.c 2 Mar 2005 13:53:50 -0000 1.43
+++ programs/wcmd/wcmdmain.c 23 Apr 2005 13:27:17 -0000
@@ -736,7 +736,7 @@
 char string[1024];
 
   va_start(ap,format);
-  vsprintf (string, format, ap);
+  vsnprintf (string, sizeof(string), format, ap);
   va_end(ap);
   WCMD_output_asis(string);
 }