about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorOlivier Le Moal <mail@olivierlemoal.fr>2015-02-21 22:22:21 +0100
committerOlivier Le Moal <mail@olivierlemoal.fr>2015-02-21 22:22:21 +0100
commit3eeafa2277c6e3002d5f8cc1aa645701527942c8 (patch)
treef232ef426d5a2b32bd68cd00620a57b3a5f179f6
parent89f472512f3ea88337bcfbee51431f1f7a1934b9 (diff)
downloadprofani-tty-3eeafa2277c6e3002d5f8cc1aa645701527942c8.tar.gz
fix segfault on self sent message carbon
-rw-r--r--src/xmpp/message.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 4f341f6a..b264df54 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -434,6 +434,11 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
         gchar *to = xmpp_stanza_get_attribute(message, STANZA_ATTR_TO);
         gchar *from = xmpp_stanza_get_attribute(message, STANZA_ATTR_FROM);
 
+        // happens when receive a carbon of a self sent message 
+        if(to == NULL) {
+            to = from;
+        }
+
         Jid *jid_from = jid_create(from);
         Jid *jid_to = jid_create(to);
         Jid *my_jid = jid_create(jabber_get_fulljid());