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:56:38 +0100
committerMichael Vetter <jubalh@iodoru.org>2021-03-25 11:56:38 +0100
commitd2dc440535c24c16a0dac054ebe4f063d69ada46 (patch)
tree9f79d7e64bf655dad132fcc9471129ba8ee97345 /src/xmpp
parente396e863dda53839ba4d00d175999e07d6143369 (diff)
downloadprofani-tty-d2dc440535c24c16a0dac054ebe4f063d69ada46.tar.gz
message: fix potential segfault in _receipt_request_handler
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/message.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 00d8ec1a..80a4850d 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -1176,9 +1176,13 @@ _receipt_request_handler(xmpp_stanza_t* const stanza)
     }
 
     const gchar* from = xmpp_stanza_get_from(stanza);
-    Jid* jid = jid_create(from);
-    _message_send_receipt(jid->fulljid, id);
-    jid_destroy(jid);
+    if (from) {
+        Jid* jid = jid_create(from);
+        if (jid) {
+            _message_send_receipt(jid->fulljid, id);
+            jid_destroy(jid);
+        }
+    }
 }
 
 static void