Package: irssi-plugin-xmpp / 0.53-1~bpo8+1

singpolyma-fix-warnings.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
Description: fix 4 compiler warnings, check popenRWE return value
    xmpp-commands.c:547:4: warning: implicit declaration of function 'printtext_window' [-Wimplicit-function-declaration]
    popenRWE.c:60:3: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
    popenRWE.c:62:3: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
    popenRWE.c:64:3: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
Author: Florian Schlichting <fsfs@debian.org>

--- a/src/core/xmpp-commands.c
+++ b/src/core/xmpp-commands.c
@@ -20,6 +20,7 @@
 #include "module.h"
 #include "channels.h"
 #include "nicklist.h"
+#include "printtext.h"
 #include "recode.h"
 #include "settings.h"
 #include "signals.h"
--- a/src/core/popenRWE.c
+++ b/src/core/popenRWE.c
@@ -57,11 +57,11 @@
 		close(out[0]);
 		close(err[0]);
 		close(0);
-		dup(in[0]);
+		if(dup(in[0]) < 0) exit(2);
 		close(1);
-		dup(out[1]);
+		if(dup(out[1]) < 0) exit(2);
 		close(2);
-		dup(err[1]);
+		if(dup(err[1]) < 0) exit(2);
 
 		execvp(argv[0], (char**)argv);
 		exit(1);
--- a/src/core/tools.c
+++ b/src/core/tools.c
@@ -87,7 +87,7 @@
 	}
 
 	fflush(NULL);
-	childpid = popenRWE(rwepipe, cmd);
+	if(childpid = popenRWE(rwepipe, cmd) < 0) goto pgp_error;
 
 	if(write(rwepipe[0], input, strlen(input)) < 0) goto pgp_error;
 	if(close(rwepipe[0])) goto pgp_error;