From: John Darrington Date: Tue, 17 Nov 2020 17:27:38 +0000 (+0100) Subject: src/data/dictionary.c (make_hinted_name): Limit generated name to 64 bytes long X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23f15b12073c0e66b07fb5e58f501cab6a5f9f0f;p=pspp src/data/dictionary.c (make_hinted_name): Limit generated name to 64 bytes long --- 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); }