about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-03-18 14:39:41 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-03-18 14:39:41 +0000
commita2197a53619444fa32bb7c26aadea3f1e498e069 (patch)
tree51dae89981da677d577fb653005e1d8a8bcb0ddd /Src/utils.c
parente0ae2a59b3842e23264b19c2d1702a9c998e7278 (diff)
downloadzsh-a2197a53619444fa32bb7c26aadea3f1e498e069.tar.gz
zsh-a2197a53619444fa32bb7c26aadea3f1e498e069.tar.xz
zsh-a2197a53619444fa32bb7c26aadea3f1e498e069.zip
18359: fix bug where not enough memory was allocated if MB_LEN_MAX < 6
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c5
1 files changed, 1 insertions, 4 deletions
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;