summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-06-18 00:57:01 +0200
committerCarl Hetherington <cth@carlh.net>2024-06-18 09:50:34 +0200
commita3b17b67e77b82f79469de1e94076b6087da39a5 (patch)
treef497918c5adf3dbdfa7cec285b8f65042dcd9562
parenta6e9934aa5b7e1744275336b5082d42a4f6d8b37 (diff)
Fix "available space" count passed to snprintf (#2832).
This is wrong (too big) and it causes an abort in some snprintf checker on Ubuntu 24.04.
-rw-r--r--src/lib/digester.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/digester.cc b/src/lib/digester.cc
index 09214c3de..67a3e2398 100644
--- a/src/lib/digester.cc
+++ b/src/lib/digester.cc
@@ -67,7 +67,7 @@ Digester::get () const
char hex[MD5_DIGEST_SIZE * 2 + 1];
for (int i = 0; i < MD5_DIGEST_SIZE; ++i) {
- snprintf(hex + i * 2, MD5_DIGEST_SIZE * 2 + 1, "%02x", digest[i]);
+ snprintf(hex + i * 2, 3, "%02x", digest[i]);
}
_digest = hex;