about summary refs log tree commit diff stats
path: root/src/xmpp/stanza.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-11-12 16:18:28 +0100
committerMichael Vetter <jubalh@iodoru.org>2019-11-12 16:18:28 +0100
commit196e029b477a02d55ca1c3f37ee468d752a9e866 (patch)
tree3254128bb635f7d6028791d366dd6e50d22cd34a /src/xmpp/stanza.c
parent9bc4dc382773896c4d5c4ab74e60a02a92021d5b (diff)
downloadprofani-tty-196e029b477a02d55ca1c3f37ee468d752a9e866.tar.gz
Fix stanza_get_child_by_name_and_ns() if no name
Fix bug introduced in 68af0aad65d243e654866eac5a7cd728ee293aa0.
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r--src/xmpp/stanza.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c
index 46adb50e..bb7e9092 100644
--- a/src/xmpp/stanza.c
+++ b/src/xmpp/stanza.c
@@ -2484,9 +2484,11 @@ stanza_get_child_by_name_and_ns(xmpp_stanza_t * const stanza, const char * const
 {
     xmpp_stanza_t *child;
     const char *child_ns;
+    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_ns = xmpp_stanza_get_ns(child);
             if (child_ns && strcmp(ns, child_ns) == 0) {
                 break;