mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Fix buffer allocation that disabled showing backtrace
This commit is contained in:
parent
87fd304dc6
commit
4598668767
@ -188,10 +188,11 @@ bool get_me_gdb_output(int crashpid)
|
|||||||
{
|
{
|
||||||
// child
|
// child
|
||||||
char *argv[4];
|
char *argv[4];
|
||||||
|
char tmp[1000];
|
||||||
argv[0] = "sh";
|
argv[0] = "sh";
|
||||||
argv[1] = "-c";
|
argv[1] = "-c";
|
||||||
argv[2] = (char*)malloc(1000); // Who should free(argv[2]) ?
|
argv[2] = tmp;
|
||||||
snprintf (argv[2], sizeof(argv[2])-1, "echo bt>/tmp/gdbbatch; echo q>>/tmp/gdbbatch; "GDBPATH" %s --core core.%d --command /tmp/gdbbatch --quiet > /tmp/gdboutput", cmd_, crashpid);
|
snprintf (argv[2], 999, "echo bt>/tmp/gdbbatch; echo q>>/tmp/gdbbatch; "GDBPATH" %s --core core.%d --command /tmp/gdbbatch --quiet > /tmp/gdboutput", cmd_, crashpid);
|
||||||
argv[3] = NULL;
|
argv[3] = NULL;
|
||||||
|
|
||||||
if (execve ("/bin/sh", argv, environ) == -1)
|
if (execve ("/bin/sh", argv, environ) == -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user