Branch: master

b8038182 2014-11-18 14:21:18 Timothy Pearson
Do not register crash handler for Firefox, Thunderbird, Chromium, etc.
M src/qt_qt_wrapper.cpp
diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp
index d8467ee..a701f52 100644
--- a/src/qt_qt_wrapper.cpp
+++ b/src/qt_qt_wrapper.cpp
@@ -106,7 +106,7 @@
 Atom kipcCommAtom;
 Atom desktopWindowAtom;
 
-static int argc_fake = 1;
+static const int argc_fake = 2;
 static char** argv_fake;
 
 static TDEAboutData aboutData("gtk-qt-engine", I18N_NOOP("gtk-qt-engine"), "v0.1",
@@ -363,10 +363,11 @@
 		// Does baseline internally generate SIGSEGVs as part of normal operation?
 		cmdlineCrashHandler = "--nocrashhandler";
 	}
+
 	int cmdlineCrashHandlerLength = cmdlineCrashHandler.length() + 1;
 
 	// Create a new TDEApplication and supply it with fake data to keep its constructor happy
-	argv_fake = (char**) malloc(sizeof(char*));
+	argv_fake = (char**) malloc(sizeof(char*)*argc_fake);
 	argv_fake[0] = (char*) malloc(sizeof(char) * cmdlineAppNameLength);
 	argv_fake[1] = (char*) malloc(sizeof(char) * cmdlineCrashHandlerLength);
 	strncpy(argv_fake[0], cmdlineAppName.ascii(), cmdlineAppNameLength);