mirror of https://github.com/Icinga/icinga2.git
Merge pull request #5861 from Icinga/fix/invalid-memory-access
Fix incorrect memory access
This commit is contained in:
commit
85f3865718
|
@ -634,7 +634,10 @@ void Application::AttachDebugger(const String& filename, bool interactive)
|
||||||
my_pid_str,
|
my_pid_str,
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
argv = const_cast<char **>(uargv);
|
argv = const_cast<char **>(uargv);
|
||||||
|
|
||||||
|
(void) execvp(argv[0], argv);
|
||||||
} else {
|
} else {
|
||||||
const char *uargv[] = {
|
const char *uargv[] = {
|
||||||
"gdb",
|
"gdb",
|
||||||
|
@ -649,10 +652,12 @@ void Application::AttachDebugger(const String& filename, bool interactive)
|
||||||
"quit",
|
"quit",
|
||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
argv = const_cast<char **>(uargv);
|
argv = const_cast<char **>(uargv);
|
||||||
|
|
||||||
|
(void) execvp(argv[0], argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)execvp(argv[0], argv);
|
|
||||||
perror("Failed to launch GDB");
|
perror("Failed to launch GDB");
|
||||||
free(my_pid_str);
|
free(my_pid_str);
|
||||||
_exit(0);
|
_exit(0);
|
||||||
|
|
Loading…
Reference in New Issue