From a2197a53619444fa32bb7c26aadea3f1e498e069 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 18 Mar 2003 14:39:41 +0000 Subject: 18359: fix bug where not enough memory was allocated if MB_LEN_MAX < 6 --- Src/utils.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index 2b0e7faea..57a5e6771 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -3311,15 +3311,12 @@ getkeystring(char *s, int *len, int fromwhere, int *misc) char *inptr, *outptr; # endif size_t count; - size_t buflen = MB_LEN_MAX * (strlen(s) / 6) + (strlen(s) % 6) + 1; -#else - size_t buflen = strlen(s) + 1; #endif if (fromwhere == 6) t = buf = tmp; else if (fromwhere != 4) - t = buf = zhalloc(buflen); + t = buf = zhalloc(strlen(s) + 1); else { t = buf = s; s += 2; -- cgit v1.2.3