about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-06-21 13:02:11 +0200
committerPaul Fariello <paul@fariello.eu>2019-06-21 12:03:08 +0200
commitac96a6951d04a7de0ffc8bf3c177b34037925f2c (patch)
treea934532ba74f3f02d6eaf3418eb97f0975d110f3 /src
parent4b62f8f2ba512174ea789006eaa1a425ad37974e (diff)
downloadprofani-tty-ac96a6951d04a7de0ffc8bf3c177b34037925f2c.tar.gz
Fix segfault when receiving messages without ID
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/message.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 3d4807fe..4f088b8e 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -798,7 +798,9 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
 
     ProfMessage *message = message_init();
     message->jid = jid;
-    message->id = strdup(id);
+    if (id) {
+        message->id = strdup(id);
+    }
 
     message->body = xmpp_message_get_body(stanza);