From 7fda8aece2a256c5aec388f26f58c2393ddf224d Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 12 Aug 2006 14:51:51 +0000 Subject: [PATCH] revers Revision: 23549 | * allocate a terminating zero for every parsed argument The code cause a regress. and the old code is 100% correct. I spoken with janderwald about it *argc can be 0 when it call to CommandLineToArgv and he did not think of it. and agrument agrc is always 1, but that can not be take into accunt. for u do not paraser how many argc it exists you parser the current argv, like is it 0, is it 1 so on. svn path=/trunk/; revision=23554 --- reactos/base/system/rundll32/rundll32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/system/rundll32/rundll32.c b/reactos/base/system/rundll32/rundll32.c index 252e154727c..cceafa88d53 100644 --- a/reactos/base/system/rundll32/rundll32.c +++ b/reactos/base/system/rundll32/rundll32.c @@ -131,7 +131,7 @@ LPTSTR *WINAPI CommandLineToArgv(LPCTSTR lpCmdLine, int *lpArgc) } // Allocate space for the pointers in argv and the strings in one block - argv = (LPTSTR *)malloc(argc * sizeof(LPTSTR) + (_tcslen(lpArg) + argc) * sizeof(TCHAR)); + argv = (LPTSTR *)malloc(argc * sizeof(LPTSTR) + (_tcslen(lpArg) + 1) * sizeof(TCHAR)); if (!argv) { // Memory allocation failed