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

singpolyma-0014-fix-some-assertion-failures.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
46
47
48
From c8e5b81a0825ec33c7b850e8eb998f3eb33fcc5d Mon Sep 17 00:00:00 2001
From: Stephen Paul Weber <singpolyma@singpolyma.net>
Date: Sun, 24 Apr 2011 14:11:59 -0500
Subject: [PATCH 14/18] fix some assertion failures

---
 src/core/xmpp-commands.c |  2 +-
 src/core/xmpp-servers.c  | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

--- a/src/core/xmpp-commands.c
+++ b/src/core/xmpp-commands.c
@@ -538,7 +538,7 @@
 static void
 cmd_xmpppgp(const char *data, XMPP_SERVER_REC *server, WI_ITEM_REC *item)
 {
-	if(IS_QUERY(item)) {
+	if(IS_QUERY(item) && QUERY(item)->name) {
 		XMPP_ROSTER_USER_REC *user = rosters_find_user(server->roster, \
 			QUERY(item)->name, NULL, NULL);
 		XMPP_ROSTER_RESOURCE_REC *res;
--- a/src/core/xmpp-servers.c
+++ b/src/core/xmpp-servers.c
@@ -74,14 +74,16 @@
 	} else {
 		XMPP_ROSTER_USER_REC *user;
 		str = rosters_resolve_name(XMPP_SERVER(server), target);
-		user = rosters_find_user(((XMPP_SERVER_REC*)server)->roster, str, \
-			NULL, NULL);
-		if(user) {
-			XMPP_ROSTER_RESOURCE_REC *res;
-			res = rosters_find_resource(user->resources, \
-				xmpp_extract_resource(str));
-			if(res && res->pgp_encrypt) {
-				encrypt_to = res->pgp_keyid;
+		if(str) {
+			user = rosters_find_user(((XMPP_SERVER_REC*)server)->roster, \
+			                         str, NULL, NULL);
+			if(user) {
+				XMPP_ROSTER_RESOURCE_REC *res;
+				res = rosters_find_resource(user->resources, \
+					xmpp_extract_resource(str));
+				if(res && res->pgp_encrypt) {
+					encrypt_to = res->pgp_keyid;
+				}
 			}
 		}
 		recoded = xmpp_recode_out(str != NULL ? str : target);