From 099260a4e3bf0eddbf9375ba58a9bfc78287b754 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 25 Mar 2021 15:37:54 +0100 Subject: message: make _handle_receipt_received safer --- src/xmpp/message.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 3cb56c96..1303b38b 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -1142,7 +1142,7 @@ _handle_receipt_received(xmpp_stanza_t* const stanza) xmpp_stanza_t* receipt = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_RECEIPTS); if (receipt) { const char* name = xmpp_stanza_get_name(receipt); - if (g_strcmp0(name, "received") != 0) { + if ((name == NULL) || (g_strcmp0(name, "received") != 0)) { return; } @@ -1157,6 +1157,10 @@ _handle_receipt_received(xmpp_stanza_t* const stanza) } Jid* jidp = jid_create(fulljid); + if(!jidp) { + return; + } + sv_ev_message_receipt(jidp->barejid, id); jid_destroy(jidp); } -- cgit 1.4.1-2-gfad0