mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +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()),
|
mbedtls_md5(reinterpret_cast<const unsigned char *>(input.c_str()),
|
||||||
input.size(), digest);
|
input.size(), digest);
|
||||||
|
|
||||||
char buf[32];
|
char buf[33];
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
sprintf(buf+i*2, "%02x", digest[i]);
|
sprintf(buf+i*2, "%02x", digest[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user