Skip to content

Commit ae02076

Browse files
defanatorzimmerle
authored andcommitted
Fixed buffer overflow in Utils::Md5::hexdigest()
Found via failed test (auditlog.json) on Alpine Linux 3.8.2.
1 parent 3c1fba2 commit ae02076

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/md5.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ std::string Md5::hexdigest(std::string& input) {
1313
mbedtls_md5(reinterpret_cast<const unsigned char *>(input.c_str()),
1414
input.size(), digest);
1515

16-
char buf[32];
16+
char buf[33];
1717
for (int i = 0; i < 16; i++) {
1818
sprintf(buf+i*2, "%02x", digest[i]);
1919
}

0 commit comments

Comments
 (0)