From: Gregor Schneider Date: Sat, 28 Nov 2009 15:16:36 +0000 (+0000) Subject: [msvcrt] X-Git-Tag: backups/aicom-network-stable@46924~469 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=8e09c97596a4fe8a700bfe30ca9d15b928c055a4 [msvcrt] - Fix buffer calculation in argvtoW, missed unicode character size - Fixes another crash during GIMP startup, now GIMP starts (bug #3503, part 2) - Fix same problem in valisttoA/W svn path=/trunk/; revision=44307 --- diff --git a/reactos/lib/sdk/crt/process/process.c b/reactos/lib/sdk/crt/process/process.c index 2932bc6b836..53f752310fc 100644 --- a/reactos/lib/sdk/crt/process/process.c +++ b/reactos/lib/sdk/crt/process/process.c @@ -128,7 +128,7 @@ argvtosT(const _TCHAR* const* argv, _TCHAR delim) len += _tcslen(argv[i]) + 1; } - str = ptr = (_TCHAR*) malloc(len + 1); + str = ptr = (_TCHAR*) malloc((len + 1) * sizeof(_TCHAR)); if (str == NULL) return NULL; @@ -163,7 +163,7 @@ valisttosT(const _TCHAR* arg0, va_list alist, _TCHAR delim) } while(ptr != NULL); - str = (_TCHAR*) malloc(len + 1); + str = (_TCHAR*) malloc((len + 1) * sizeof(_TCHAR)); if (str == NULL) return NULL;