From 733154a78524daecf1542c4f6fba96474ac3426f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 4 Jun 2023 07:40:47 -0700 Subject: [PATCH] dictionary: Properly size string buffer in make_hinted_name(). This causes a test failure on 32-bit platforms, where INT_BUFSIZE_BOUND(unsigned long) is smaller than F26ADIC_STRLEN_MAX + 1. Fixes: 2ba8dc2955f8 ("spreadsheet-reader: Merge duplicate code with libpspp/str.h.") Thanks to Friedrich Beckmann for reporting the problem. --- src/data/dictionary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 653ed941f1..8b5f381296 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -1167,7 +1167,7 @@ make_hinted_name (const struct dictionary *dict, const char *hint) for (i = 0; i < ULONG_MAX; i++) { - char suffix[INT_BUFSIZE_BOUND (i) + 1]; + char suffix[1 + F26ADIC_STRLEN_MAX + 1]; suffix[0] = '_'; str_format_26adic (i + 1, true, &suffix[1], sizeof suffix - 1); -- 2.30.2