From 41fd33fdc3dacef507b987ed316aec2b0d684317 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 3 Dec 2024 17:09:00 +0100 Subject: [PATCH] Changed an snprintf call in MathUtil as it could cause false positives for buffer overflow checks when building with GCC fortification --- es-core/src/utils/MathUtil.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/es-core/src/utils/MathUtil.cpp b/es-core/src/utils/MathUtil.cpp index 62a963e6e..2132ad3ac 100644 --- a/es-core/src/utils/MathUtil.cpp +++ b/es-core/src/utils/MathUtil.cpp @@ -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); }