From 0629ea0a98f178d62f9ec2c59d20c61628df9b75 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 14 Dec 2017 15:04:25 +0100 Subject: [PATCH] Fix incorrect memory access --- lib/base/application.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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);