From c8b88733efc8be47ceb3602286755e372acdfa9f Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 27 Apr 2022 16:17:48 +0200 Subject: [PATCH] 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 --- src/xmpp/ox.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xmpp/ox.c b/src/xmpp/ox.c index f43fbd60..0fa5cece 100644 --- a/src/xmpp/ox.c +++ b/src/xmpp/ox.c @@ -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