diff GUIFont.cpp @ 200:1527f66fd81b

Buffer overflow in credits window
author Nomad
date Sat, 16 Feb 2013 22:35:58 +0200
parents 038a4d09406f
children c0bfb386b15f
line wrap: on
line diff
--- a/GUIFont.cpp	Sat Feb 16 22:20:51 2013 +0200
+++ b/GUIFont.cpp	Sat Feb 16 22:35:58 2013 +0200
@@ -1,4 +1,6 @@
 #include <string>
+#include <assert.h>
+
 #include "LOD.h"
 #include "GUIFont.h"
 #include "GUIWindow.h"
@@ -23,11 +25,11 @@
 
 char temp_string[2048];
 
-char pTmpBuf3[2048];
+char pTmpBuf3[10000];
 
 //----- (0044C448) --------------------------------------------------------
 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...)
-	{
+{
 	
 	int pallete_index; // eax@3
 	GUIFont *pFont;
@@ -348,6 +350,8 @@
   v8 = strlen(pString);
   v9 = v8;
   v39 = v8;
+
+  assert(strlen(v6) < sizeof(pTmpBuf3));
   strcpy(pTmpBuf3, v6);
   v10 = a5;
   v11 = v35;