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

singpolyma-0011-Fix-some-potential-crashing-issues.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
From e05ba5a190f6d0be3354537a1486fcbe9a40c20c Mon Sep 17 00:00:00 2001
From: Stephen Paul Weber <singpolyma@singpolyma.net>
Date: Sat, 23 Apr 2011 15:04:26 -0500
Subject: [PATCH 11/18] Fix some potential crashing issues

---
 src/core/protocol.c | 8 +++++---
 src/core/rosters.c  | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

--- a/src/core/protocol.c
+++ b/src/core/protocol.c
@@ -63,10 +63,12 @@
 		LmMessageNode *x;
 		char *signature = call_gpg("-ab", str, NULL, 0, 1);
 
-		x = lm_message_node_add_child(lmsg->node, "x", signature);
-		lm_message_node_set_attribute(x, "xmlns", "jabber:x:signed");
+		if(signature) {
+			x = lm_message_node_add_child(lmsg->node, "x", signature);
+			lm_message_node_set_attribute(x, "xmlns", "jabber:x:signed");
 
-		free(signature);
+			free(signature);
+		}
 	}
 
 	g_free(str);
--- a/src/core/rosters.c
+++ b/src/core/rosters.c
@@ -513,7 +513,7 @@
 			send_to_gpg[0] = '\0';
 			strcat(send_to_gpg, "-----BEGIN PGP SIGNATURE-----\n\n");
 			strcat(send_to_gpg, signature->value);
-			strcat(send_to_gpg, "----- END PGP SIGNATURE-----\n");
+			strcat(send_to_gpg, "-----END PGP SIGNATURE-----\n");
 
 			from_gpg = call_gpg("--verify", send_to_gpg, send_status, 1, 0);
 			free(send_to_gpg);