Changed an snprintf call in MathUtil as it could cause false positives for buffer overflow checks when building with GCC fortification

This commit is contained in:
Leon Styhre 2024-12-03 17:09:00 +01:00
parent 96be5c1317
commit 41fd33fdc3

View file

@ -187,8 +187,7 @@ namespace Utils
// Convert to hex string.
char buf[33];
for (int i {0}; i < 16; ++i)
snprintf(buf + i * 2, 16, "%02x", digest[i]);
buf[32] = 0;
snprintf(buf + i * 2, 3, "%02x", digest[i]);
return std::string(buf);
}