From ae020763402c1d4044b6565654f508370a3d58a6 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Mon, 14 Jan 2019 09:04:45 +0300 Subject: [PATCH] Fixed buffer overflow in Utils::Md5::hexdigest() Found via failed test (auditlog.json) on Alpine Linux 3.8.2. --- src/utils/md5.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/md5.cc b/src/utils/md5.cc index 1480dc0e..0601bf93 100644 --- a/src/utils/md5.cc +++ b/src/utils/md5.cc @@ -13,7 +13,7 @@ std::string Md5::hexdigest(std::string& input) { mbedtls_md5(reinterpret_cast(input.c_str()), input.size(), digest); - char buf[32]; + char buf[33]; for (int i = 0; i < 16; i++) { sprintf(buf+i*2, "%02x", digest[i]); }