From 56751b1cd2c4700c71c545f2246adf602c97fdf5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 12 Sep 2025 08:11:53 -0400 Subject: [PATCH] Fix hash error message Wrong number of arguments was causing a format assertion. (cherry picked from commit c6d06ce486ad6b8e5d9e4a923ab750128e54e2db) --- src/libutil/hash.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index e469957a0..220181ed6 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -135,7 +135,8 @@ static Hash parseLowLevel(std::string_view rest, HashAlgorithm algo, DecodeNameP e.addTrace({}, "While decoding hash '%s'", rest); } if (d.size() != res.hashSize) - throw BadHash("invalid %s hash '%s' %d %d", pair.encodingName, rest); + throw BadHash( + "invalid %s hash '%s', length %d != expected length %d", pair.encodingName, rest, d.size(), res.hashSize); assert(res.hashSize); memcpy(res.hash, d.data(), res.hashSize);