Permalink
Browse files

compiler/ide: Various tweaks to buffer sizes for holding command argu…

…ments (Buffer overflow were causing ecp crashes with too long list of include paths)

Note: Should switch all these to dynamic buffers
  • Loading branch information...
1 parent 17415ef commit 32b7896746eb1ea3f02838d99a6b16ecb9165fee @jerstlouis jerstlouis committed Sep 3, 2012
View
@@ -309,7 +309,8 @@ class CompilerApp : Application
else
{
DualPipe cppOutput;
- char command[1024];
+ // TODO: Improve this
+ char command[MAX_F_STRING*3];
SetGlobalData(&globalData);
SetExcludedSymbols(&_excludedSymbols);
View
@@ -1458,7 +1458,8 @@ class PrecompApp : Application
printf($"Syntax:\n ecp [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n");
else
{
- char command[1024];
+ // TODO: Improve this
+ char command[MAX_F_STRING*3];
DualPipe cppOutput;
SetGlobalContext(globalContext);
View
0 deps/libffi-3.0.11/configure 100644 → 100755
No changes.
View
@@ -333,6 +333,7 @@ _DualPipe * _DualPipeOpen(PipeOpenMode mode, char * commandLine, char * env, voi
tokens[numTokens] = null;
if(env)
{
+ // TOFIX: env must be split into separate strings!!
if(execve(tokens[0], (char **)tokens, env) < 0)
{
__ecereNameSpace__ecere__com__eSystem_Delete(commandLineCopy);
@@ -1424,7 +1424,8 @@ class Debugger
{
if(gdbHandle)
{
- char string[MAX_F_STRING];
+ // TODO: Improve this limit
+ static char string[MAX_F_STRING*3];
va_list args;
va_start(args, format);
@@ -1445,7 +1446,8 @@ class Debugger
if(ide.gdbDialog)
ide.gdbDialog.AddCommand(string);
#endif
- gdbHandle.Printf("%s\n", string);
+ strcat(string,"\n");
+ gdbHandle.Puts(string);
if(focus)
Process_ShowWindows(targetProcessId);
@@ -2034,6 +2034,7 @@ private:
}
f.Printf("\nFORCE_64_BIT = %s", compiler.supportsBitDepth ? "-m64" : "");
f.Printf("\nFORCE_32_BIT = %s", compiler.supportsBitDepth ? "-m32" : "");
+ f.Printf("\n");
delete f;
}
@@ -250,7 +250,11 @@ public:
file.Printf("\n Execution Data\n");
if(commandLineArgs && commandLineArgs[0])
- file.Printf("\n Command Line Arguments = %s\n", commandLineArgs);
+ {
+ file.Printf("\n Command Line Arguments = ");
+ file.Puts(commandLineArgs);
+ file.Printf("\n");
+ }
if(environmentVars.count)
{

0 comments on commit 32b7896

Please sign in to comment.