diff options
author | James Booth <boothj5@gmail.com> | 2014-05-05 22:01:27 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-05-05 22:01:27 +0100 |
commit | ba8d1325ad50dad43f7c0913f9e97d5fad4149b0 (patch) | |
tree | 96ffa6dd3faf09918102b63f8b55ce004e5dc6ff /src/xmpp | |
parent | f247f367e92cb7da5299c30ab88e6bfc3f6cc7d2 (diff) | |
download | profani-tty-ba8d1325ad50dad43f7c0913f9e97d5fad4149b0.tar.gz |
Added null check for presence error stanza namespace element
Issue #341
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/presence.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 19ab3c03..7969f0c0 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -336,7 +336,10 @@ _presence_error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM); xmpp_stanza_t *error_stanza = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_ERROR); xmpp_stanza_t *x = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_X); - char *xmlns = xmpp_stanza_get_ns(x); + char *xmlns = NULL; + if (x != NULL) { + xmlns = xmpp_stanza_get_ns(x); + } char *type = NULL; if (error_stanza != NULL) { type = xmpp_stanza_get_attribute(error_stanza, STANZA_ATTR_TYPE); |