Author: greatlrd Date: Sat Aug 12 18:51:51 2006 New Revision: 23554
URL: http://svn.reactos.org/svn/reactos?rev=23554&view=rev Log: 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.
Modified: trunk/reactos/base/system/rundll32/rundll32.c
Modified: trunk/reactos/base/system/rundll32/rundll32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/rundll32/rundll... ============================================================================== --- trunk/reactos/base/system/rundll32/rundll32.c (original) +++ trunk/reactos/base/system/rundll32/rundll32.c Sat Aug 12 18:51:51 2006 @@ -131,7 +131,7 @@ }
// 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