From: Collin Funk Date: Wed, 31 Dec 2025 18:11:47 +0000 (+0100) Subject: msgfmt: Don't overflow the stack with large values for --alignment. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=969c02603826f16a0223820fbdc379bc25d93b2e;p=thirdparty%2Fgettext.git msgfmt: Don't overflow the stack with large values for --alignment. Reported by at . * gettext-tools/src/write-mo.c (write_table): Use xmalloca instead of alloca to allocate the buffer to fill with NUL bytes. --- diff --git a/gettext-tools/src/write-mo.c b/gettext-tools/src/write-mo.c index 07f08d30e..e3b81fef4 100644 --- a/gettext-tools/src/write-mo.c +++ b/gettext-tools/src/write-mo.c @@ -1010,7 +1010,7 @@ write_table (FILE *output_file, message_list_ty *mlp) offset = end_offset; /* A few zero bytes for padding. */ - char *null = (char *) alloca (alignment); + char *null = (char *) xmalloca (alignment); memset (null, '\0', alignment); /* Now write the original strings. */