From 23f15b12073c0e66b07fb5e58f501cab6a5f9f0f Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 17 Nov 2020 18:27:38 +0100 Subject: [PATCH] src/data/dictionary.c (make_hinted_name): Limit generated name to 64 bytes long --- src/data/dictionary.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/dictionary.c b/src/data/dictionary.c index d2768cad50..9c73e0ea44 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -1094,6 +1094,9 @@ make_hinted_name (const struct dictionary *dict, const char *hint) size_t ofs; int mblen; + if (hint_len > ID_MAX_LEN) + hint_len = ID_MAX_LEN; + /* The allocation size here is OK: characters that are copied directly fit OK, and characters that are not copied directly are replaced by a single '_' byte. If u8_mbtouc() replaces bad input by 0xfffd, then that will get @@ -1200,6 +1203,7 @@ dict_make_unique_var_name (const struct dictionary *dict, const char *hint, if (hinted_name != NULL) return hinted_name; } + return make_numeric_name (dict, num_start); } -- 2.30.2