Index: code/osapi/outwnd_unix.cpp
===================================================================
--- code/osapi/outwnd_unix.cpp	(revision 6022)
+++ code/osapi/outwnd_unix.cpp	(working copy)
@@ -156,14 +156,15 @@
 
 void outwnd_printf2(char *format, ...)
 {
-	char tmp[MAX_LINE_WIDTH*4];
+	char tmp[MAX_LINE_WIDTH*4] = {'\0'};
 	va_list args;
 
 	if (format == NULL)
 		return;
 
 	va_start(args, format);
-	vsprintf(tmp, format, args);
+	// Echelon9 - Switched from vsprintf to vsnprintf to prevent overflow of tmp
+	vsnprintf(tmp, sizeof(tmp)-1,format, args);
 	va_end(args);
 
 	outwnd_print("General", tmp);
@@ -171,14 +172,15 @@
 
 void outwnd_printf(char *id, char *format, ...)
 {
-	char tmp[MAX_LINE_WIDTH*4];
+	char tmp[MAX_LINE_WIDTH*4] = {'\0'};
 	va_list args;
 
 	if ( (id == NULL) || (format == NULL) )
 		return;
 
 	va_start(args, format);
-	vsprintf(tmp, format, args);
+	// Echelon9 - Switched from vsprintf to vsnprintf to prevent overflow of tmp
+	vsnprintf(tmp, sizeof(tmp)-1,format, args);
 	va_end(args);
 
 	outwnd_print(id, tmp);
