summaryrefslogtreecommitdiff
path: root/src/disco.c
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-01-28 12:55:34 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-01-28 13:15:51 +0000
commit14732bf5081f20aa314c3530e4c6a38155f75a62 (patch)
tree15e23ddc45a7fceaa358aa070ef9eab9d3d104bd /src/disco.c
parenta7c0fccb5bbf66e05a0062a3d7056b6d1c57bd9a (diff)
disco: don't crash on replies whose <query/> is missing
This is a regression from the BYE-BYE-LOUDMOUTH branch. The logic in request_reply_cb is meant to be: • if the stanza is an error, pass (with 'err' having been filled in); • else, if there is no <query/> node in the reply, set 'err' to that effect; • now call the callback; it is guaranteed that if err is NULL, query_node is not NULL. I inverted the check for the return value of wocky_stanza_extract_errors(): it returns TRUE if 'reply_msg' was an error, not FALSE.
Diffstat (limited to 'src/disco.c')
-rw-r--r--src/disco.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/disco.c b/src/disco.c
index cc374260a..a32ce3c48 100644
--- a/src/disco.c
+++ b/src/disco.c
@@ -401,7 +401,7 @@ request_reply_cb (GabbleConnection *conn, WockyStanza *sent_msg,
wocky_stanza_get_top_node (reply_msg),
"query", disco_type_to_xmlns (request->type));
- if (!wocky_stanza_extract_errors (reply_msg, NULL, &err, NULL, NULL))
+ if (wocky_stanza_extract_errors (reply_msg, NULL, &err, NULL, NULL))
{
/* pass */
}