From 9d4b6c71c0cd089bb94296fab50a703735b89ccd Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 18 Mar 2023 12:34:39 -0700 Subject: [PATCH] data-out: Make binary output buffer big enough for a null terminator. The max width for binary output is 16, for P or PK format, plus there needs to be room for a null terminator, for a total width of 17 bytes. The buffer here was undersized at only 16 bytes. This commit fixes the problem. Thanks to Youngseok Choi for reporting the bug. --- src/data/data-out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/data-out.c b/src/data/data-out.c index 0815a5f7c5..563c63566a 100644 --- a/src/data/data-out.c +++ b/src/data/data-out.c @@ -178,7 +178,7 @@ data_out_pool (const union value *input, const char *input_encoding, } else if (fmt_get_category (format.type) == FMT_CAT_BINARY) { - char tmp[16]; + char tmp[17]; assert (format.w + 1 <= sizeof tmp); converters[format.type] (input, format, settings, tmp); -- 2.30.2