1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

message: make _handle_receipt_received safer

This commit is contained in:
Michael Vetter 2021-03-25 15:37:54 +01:00
parent 2236242407
commit 099260a4e3

View File

@ -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);
}