From 503589272556fe9c8b582c7c1b56fcefcd42bbc5 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 28 Feb 2011 12:05:31 +0000 Subject: Frank, 28812 as modified in 28813: fix allocation of wide array in wcs_ztrdup() --- ChangeLog | 8 +++++++- Src/string.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13964dcea..95e709e8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-02-28 Peter Stephenson + + * Frank, 28812, modified as in 28813: Src/string.c: wcs_ztrdup() + needs to allocate array of wchar_t. Looks like this isn't + currently used anywhere. + 2011-02-27 Wayne Davison * Nikolai Weibull: 28649,28804: Completion/Unix/Command/_git: @@ -14264,5 +14270,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5209 $ +* $Revision: 1.5210 $ ***************************************************** diff --git a/Src/string.c b/Src/string.c index 2bd1baea3..04e7446c9 100644 --- a/Src/string.c +++ b/Src/string.c @@ -64,7 +64,7 @@ wcs_ztrdup(const wchar_t *s) if (!s) return NULL; - t = (wchar_t *)zalloc(wcslen((wchar_t *)s) + 1); + t = (wchar_t *)zalloc(sizeof(wchar_t) * (wcslen((wchar_t *)s) + 1)); wcscpy(t, s); return t; } -- cgit 1.4.1