diff options
author | Michael Vetter <jubalh@iodoru.org> | 2019-11-14 19:22:06 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2019-11-14 19:22:06 +0100 |
commit | 548b64f6c579cc70776eb817938f0ab4b64b007a (patch) | |
tree | 8c7a7b0945222c42cd579798eb473100e38ed533 | |
parent | 46fd7150e5e22f986b151ef01eaffa673cff9f1e (diff) | |
download | profani-tty-548b64f6c579cc70776eb817938f0ab4b64b007a.tar.gz |
Fix stanza_get_child_by_name_and_from() strcmp
Fix https://github.com/profanity-im/profanity/issues/1227
-rw-r--r-- | src/xmpp/stanza.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 9fe5b0e9..7a744fad 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -1177,9 +1177,11 @@ stanza_get_child_by_name_and_from(xmpp_stanza_t * const stanza, const char * con { xmpp_stanza_t *child; const char *child_from; + const char *child_name; for (child = xmpp_stanza_get_children(stanza); child; child = xmpp_stanza_get_next(child)) { - if (strcmp(name, xmpp_stanza_get_name(child)) == 0) { + child_name = xmpp_stanza_get_name(child); + if (child_name && strcmp(name, child_name) == 0) { child_from = xmpp_stanza_get_attribute(child, STANZA_ATTR_FROM); if (child_from && strcmp(from, child_from) == 0) { break; |