Displaying 2 results from an estimated 2 matches for "stackargs".
Did you mean:
stackargv
2015 Oct 13
0
[PATCH 2/2] core: Fix stack overflow when reloading config
...again:
return rv;
}
+__export int start_ldlinux(int argc, char **argv)
+{
+ /* These variables are static to survive the longjmp. */
+ static int has_jmpbuf = 0;
+ static jmp_buf restart;
+ static int savedargc;
+ static char *heapargs;
+ static size_t argsmem = 0;
+ char **stackargv;
+ char *stackargs;
+ char *p, *q;
+ int i;
+
+
+ /* 1. Save the arguments on the heap */
+ for (i = 0; i < argc; i++)
+ argsmem += strlen(argv[i]) + 1;
+
+ savedargc = argc;
+ heapargs = malloc(argsmem);
+
+ p = heapargs;
+ for (i = 0; i < savedargc; i++) {
+ q = argv[i];
+ while (*q)
+ *p++ = *q++;
+
+...
2015 Oct 13
5
[PATCH 0/2] Stack overflows when running commands
From: Sylvain Gault <sylvain.gault at gmail.com>
Hello there,
I propose 2 patches that fix two possible stack overflows either when running a
COM32 module or when loading a new config file.
I didn't find a better way to do this than to use the infamous setjmp/longjmp
functions to restore the stack to a previous state. This makes the logic a bit
more complex, but the behavior is not