From bed962a7bc6de0afd3828d991d46525f6b346d32 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Mon, 27 Mar 2023 05:39:50 +0200 Subject: Check for buffer size --- gen_cmake.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gen_cmake.c') diff --git a/gen_cmake.c b/gen_cmake.c index c3bc110..0f11407 100644 --- a/gen_cmake.c +++ b/gen_cmake.c @@ -22,8 +22,8 @@ char const *sz_(str_t const s) { int n = s.size; if (n > 999) n = 999; - memcpy(buf, s.values, s.size); - buf[s.size] = '\0'; + memcpy(buf, s.values, n); + buf[n] = '\0'; return buf; } -- cgit v1.2.3