1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-22 00:21:27 +01:00

18359: fix bug where not enough memory was allocated if MB_LEN_MAX < 6

This commit is contained in:
Oliver Kiddle 2003-03-18 14:39:41 +00:00
parent e0ae2a59b3
commit a2197a5361
2 changed files with 6 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2003-03-18 Oliver Kiddle <opk@zsh.org>
* 18359: Src/utils.c: fix bug from 18343 where not enough memory
was allocated if MB_LEN_MAX < 6
2003-03-18 Doug Kearns <djkea2@mugca.its.monash.edu.au>
* unposted: Completion/Unix/Command/_xmlsoft: remove unnecessary

View file

@ -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;