From 2fa6e2e2d1ffb8811b5d5f36f344f11a6c22283b Mon Sep 17 00:00:00 2001 From: hundertzwei <46927478+hundertzwei@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:50:17 +0200 Subject: [PATCH] Update FvwmAuto.c from gcc-12 up, this modul will terminated with *** buffer overflow detected ***. That's because the sprintf further down will copy not only the string, but also a linefeed and a terminating null-byte at the end of the buffer. This is two times off by one. --- modules/FvwmAuto/FvwmAuto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/FvwmAuto/FvwmAuto.c b/modules/FvwmAuto/FvwmAuto.c index d789797a1..8c3a1f17d 100644 --- a/modules/FvwmAuto/FvwmAuto.c +++ b/modules/FvwmAuto/FvwmAuto.c @@ -344,7 +344,7 @@ main(int argc, char **argv) { len += 32; } - buf = safemalloc(len); + buf = safemalloc(len + 1 + 1 ); // '\n' '\0' at the end of the string while (!isTerminated) {