about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-03-25 11:38:22 +0100
committerMichael Vetter <jubalh@iodoru.org>2021-03-25 11:38:22 +0100
commitf21a99eaf8fcad5456110580b5aed1264f25060b (patch)
tree0c0877095bb88e1629af625e5ef4615dea0e0b66 /src/xmpp
parente656bdb83cee144fe243b4eacd9fe8a0768c19be (diff)
downloadprofani-tty-f21a99eaf8fcad5456110580b5aed1264f25060b.tar.gz
message: fix possible segfault in _handle_muc_user
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/message.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index a88956f9..6924b509 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -877,6 +877,10 @@ _handle_muc_user(xmpp_stanza_t* const stanza)
     xmpp_stanza_t* xns_muc_user = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_MUC_USER);
     const char* room = xmpp_stanza_get_from(stanza);
 
+    if (!xns_muc_user) {
+        return;
+    }
+
     if (!room) {
         log_warning("Message received with no from attribute, ignoring");
         return;