mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-27 10:06:22 +00:00
message: make _handle_receipt_received safer
This commit is contained in:
@@ -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);
|
xmpp_stanza_t* receipt = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_RECEIPTS);
|
||||||
if (receipt) {
|
if (receipt) {
|
||||||
const char* name = xmpp_stanza_get_name(receipt);
|
const char* name = xmpp_stanza_get_name(receipt);
|
||||||
if (g_strcmp0(name, "received") != 0) {
|
if ((name == NULL) || (g_strcmp0(name, "received") != 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1157,6 +1157,10 @@ _handle_receipt_received(xmpp_stanza_t* const stanza)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Jid* jidp = jid_create(fulljid);
|
Jid* jidp = jid_create(fulljid);
|
||||||
|
if(!jidp) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sv_ev_message_receipt(jidp->barejid, id);
|
sv_ev_message_receipt(jidp->barejid, id);
|
||||||
jid_destroy(jidp);
|
jid_destroy(jidp);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user