0
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-07-26 12:14:28 -04:00

Fix handling of roster pushes

We must only return early in cases where we received a roster push with
1. a `from` attribute
2. that `from` is not our bare JID

The server sends roster pushes without `from` attribute and we must accept
them.

Fixes #2035
Fixes: bac24601da ("Introduce `equals_our_barejid()`")

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel 2025-04-09 16:40:33 +02:00
parent 5efec675fd
commit ed44d7ad96

View File

@ -201,7 +201,7 @@ roster_set_handler(xmpp_stanza_t* const stanza)
// if from attribute exists and it is not current users barejid, ignore push
const char* from = xmpp_stanza_get_from(stanza);
if (!equals_our_barejid(from)) {
if (from && !equals_our_barejid(from)) {
log_warning("Received alleged roster push from: %s", from);
return;
}