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

ox: print invalid fingerprint instead of aborting

Asserting here is not the right thing to do at all.
A person could have a typo in the fingerprint. Or like in the case of
the reported bug just confuse the arguments.

An additional check for valid jid should be added later to the calling
function maybe.

Fix https://github.com/profanity-im/profanity/issues/1698
This commit is contained in:
Michael Vetter 2022-04-27 16:17:48 +02:00
parent 866f688621
commit c8b88733ef

View File

@ -340,7 +340,11 @@ _ox_request_public_key(const char* const jid, const char* const fingerprint)
{
assert(jid);
assert(fingerprint);
assert(strlen(fingerprint) == KEYID_LENGTH);
if (strlen(fingerprint) != KEYID_LENGTH) {
cons_show_error("Invalid fingerprint length for: %s", fingerprint);
}
cons_show("Requesting Public Key %s for %s", fingerprint, jid);
log_info("[OX] Request %s's public key %s.", jid, fingerprint);
// iq