mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fixed buffer overflow in Utils::Md5::hexdigest()
Found via failed test (auditlog.json) on Alpine Linux 3.8.2.
This commit is contained in:
parent
3c1fba278c
commit
ae02076340
@ -13,7 +13,7 @@ std::string Md5::hexdigest(std::string& input) {
|
||||
mbedtls_md5(reinterpret_cast<const unsigned char *>(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]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user