(svn r12110) [NoAI] -Fix [FS#1746]: possible segmentation fault when trying to load another script file
--- a/src/squirrel_std.cpp Sun Feb 03 20:17:54 2008 +0000
+++ b/src/squirrel_std.cpp Mon Feb 11 14:20:41 2008 +0000
@@ -5,6 +5,7 @@
#include "debug.h"
#include "squirrel.hpp"
#include "squirrel_std.hpp"
+#include "core/alloc_func.hpp"
/* abs() is normally defined to myabs(), which we don't want in this file */
#undef abs
@@ -41,7 +42,9 @@
*s++;
*s = '\0';
}
- /* And now we concat, so we are relative from the current script */
+ /* And now we concat, so we are relative from the current script
+ * First, we have to make sure we have enough space for the full path */
+ real_filename = ReallocT(real_filename, scstrlen(real_filename) + scstrlen(filename) + 1);
scstrcat(real_filename, filename);
/* Make sure we are in the root-table, so everything is included in the root-level */