From: Gunnar Beutner Date: Thu, 14 Dec 2017 14:04:25 +0000 (+0100) Subject: Fix incorrect memory access X-Git-Tag: v2.9.0~288^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0629ea0a98f178d62f9ec2c59d20c61628df9b75;p=icinga2 Fix incorrect memory access --- diff --git a/lib/base/application.cpp b/lib/base/application.cpp index 1c7a73041..87f0ca8b1 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -634,7 +634,10 @@ void Application::AttachDebugger(const String& filename, bool interactive) my_pid_str, NULL }; + argv = const_cast(uargv); + + (void) execvp(argv[0], argv); } else { const char *uargv[] = { "gdb", @@ -649,10 +652,12 @@ void Application::AttachDebugger(const String& filename, bool interactive) "quit", NULL }; + argv = const_cast(uargv); + + (void) execvp(argv[0], argv); } - (void)execvp(argv[0], argv); perror("Failed to launch GDB"); free(my_pid_str); _exit(0);