]> granicus.if.org Git - icinga2/commitdiff
Fix incorrect memory access 5861/head
authorGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 14 Dec 2017 14:04:25 +0000 (15:04 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 14 Dec 2017 14:05:04 +0000 (15:05 +0100)
lib/base/application.cpp

index 1c7a7304179825c6184b0bfadb1427f0288fb0a5..87f0ca8b136b75095b6c1a96d00491fbb6684ee1 100644 (file)
@@ -634,7 +634,10 @@ void Application::AttachDebugger(const String& filename, bool interactive)
                                my_pid_str,
                                NULL
                        };
+
                        argv = const_cast<char **>(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<char **>(uargv);
+
+                       (void) execvp(argv[0], argv);
                }
 
-               (void)execvp(argv[0], argv);
                perror("Failed to launch GDB");
                free(my_pid_str);
                _exit(0);