From 2bb79f0da191cbe74cc02b435b4b54d37951b524 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Tue, 9 Jan 2024 10:46:11 -0500 Subject: [PATCH] Update src/description.cpp Co-authored-by: Paul-Louis Ageneau --- src/description.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/description.cpp b/src/description.cpp index e89fe1237..bd4cd6350 100644 --- a/src/description.cpp +++ b/src/description.cpp @@ -1330,9 +1330,8 @@ std::string CertificateFingerprint::AlgorithmIdentifier( } bool CertificateFingerprint::isValid() const { - auto expectedSize = AlgorithmSize(algorithm); - - if (this->value.size() != expectedSize * 3 - 1) { + size_t expectedSize = AlgorithmSize(this->algorithm); + if (expectedSize == 0 || this->value.size() != expectedSize * 3 - 1) { return false; }