mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Fix segfault on /ox discover
`/ox discover` segfaults on some misconfigured? nodes because there are newlines before and after some pubkey-metadata stanzas so the newlines get treated as seperate stanzas. This commit just skips each stanza in public-keys-list that doesn't have a fingerprint. Fixes https://github.com/profanity-im/profanity/issues/1713
This commit is contained in:
parent
b4523d6c42
commit
719f3fbee0
@ -325,11 +325,14 @@ _ox_metadata_result(xmpp_stanza_t* const stanza, void* const userdata)
|
|||||||
|
|
||||||
while (pubkeymetadata) {
|
while (pubkeymetadata) {
|
||||||
const char* fingerprint = xmpp_stanza_get_attribute(pubkeymetadata, STANZA_ATTR_V4_FINGERPRINT);
|
const char* fingerprint = xmpp_stanza_get_attribute(pubkeymetadata, STANZA_ATTR_V4_FINGERPRINT);
|
||||||
if (strlen(fingerprint) == KEYID_LENGTH) {
|
|
||||||
cons_show(fingerprint);
|
if (fingerprint) {
|
||||||
} else {
|
if (strlen(fingerprint) == KEYID_LENGTH) {
|
||||||
cons_show("OX: Wrong char size of public key");
|
cons_show(fingerprint);
|
||||||
log_error("[OX] Wrong chat size of public key %s", fingerprint);
|
} else {
|
||||||
|
cons_show("OX: Wrong char size of public key");
|
||||||
|
log_error("[OX] Wrong chat size of public key %s", fingerprint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pubkeymetadata = xmpp_stanza_get_next(pubkeymetadata);
|
pubkeymetadata = xmpp_stanza_get_next(pubkeymetadata);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user