Package: boinc / 7.14.2+dfsg-3

MainDocumentWarnings.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Author: Steffen Moeller <moeller@debian.org>
Description: Nothing in this patch should be functionally relevant, only compile time warnings as by the ambiguity of the result parameter are resolved.
Index: boinc/clientgui/MainDocument.cpp
===================================================================
--- boinc.orig/clientgui/MainDocument.cpp
+++ boinc/clientgui/MainDocument.cpp
@@ -1694,7 +1694,6 @@
 }
 #else
 void CMainDocument::KillGraphicsApp(int pid) {
-    char* argv[6];
     char currentDir[1024];
     char thePIDbuf[20];
     int id, iRetVal;
@@ -1702,12 +1701,13 @@
 
     if (g_use_sandbox) {
         snprintf(thePIDbuf, sizeof(thePIDbuf), "%d", pid);
-        argv[0] = "switcher";
-        argv[1] = "/bin/kill";
-        argv[2] =  "kill";
-        argv[3] = "-KILL";
-        argv[4] = thePIDbuf;
-        argv[5] = 0;
+        char* const argv[6] = {
+           strdup("switcher"),
+	    strdup("/bin/kill"),
+	    strdup("kill"),
+	    strdup("-KILL"),
+	    thePIDbuf,0
+        };
 
         iRetVal = run_program(
             getcwd(currentDir, sizeof(currentDir)),
@@ -1717,6 +1717,10 @@
             0,
             id
         );
+	free(argv[0]);
+	free(argv[1]);
+	free(argv[2]);
+	free(argv[3]);
     } else {
         kill_program(pid);
     }