diff options
author | Michael Vetter <jubalh@iodoru.org> | 2021-03-25 11:56:38 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2021-03-25 11:56:38 +0100 |
commit | d2dc440535c24c16a0dac054ebe4f063d69ada46 (patch) | |
tree | 9f79d7e64bf655dad132fcc9471129ba8ee97345 | |
parent | e396e863dda53839ba4d00d175999e07d6143369 (diff) | |
download | profani-tty-d2dc440535c24c16a0dac054ebe4f063d69ada46.tar.gz |
message: fix potential segfault in _receipt_request_handler
-rw-r--r-- | src/xmpp/message.c | 10 |
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 |