mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
[CMD]
- In DirList, initialize stInfo.ptrHead of the dummy node to avoid invalid memory access. Fixes regression in cmd:batch svn path=/trunk/; revision=68846
This commit is contained in:
parent
2f9a846dcf
commit
4e5f69d4d1
1 changed files with 5 additions and 4 deletions
|
@ -1376,6 +1376,7 @@ DirList(LPTSTR szPath, /* [IN] The path that dir starts */
|
||||||
WARN("DEBUG: Cannot allocate memory for ptrStartNode!\n");
|
WARN("DEBUG: Cannot allocate memory for ptrStartNode!\n");
|
||||||
return 1; /* Error cannot allocate memory for 1st object */
|
return 1; /* Error cannot allocate memory for 1st object */
|
||||||
}
|
}
|
||||||
|
ptrStartNode->stInfo.ptrHead = NULL;
|
||||||
ptrNextNode = ptrStartNode;
|
ptrNextNode = ptrStartNode;
|
||||||
|
|
||||||
/*Checking ir szPath is a File with/wout extension*/
|
/*Checking ir szPath is a File with/wout extension*/
|
||||||
|
@ -1538,7 +1539,7 @@ DirList(LPTSTR szPath, /* [IN] The path that dir starts */
|
||||||
dwCount = 0;
|
dwCount = 0;
|
||||||
while (ptrNextNode->ptrNext)
|
while (ptrNextNode->ptrNext)
|
||||||
{
|
{
|
||||||
*(ptrFileArray + dwCount) = &ptrNextNode->ptrNext->stInfo;
|
ptrFileArray[dwCount] = &ptrNextNode->ptrNext->stInfo;
|
||||||
ptrNextNode = ptrNextNode->ptrNext;
|
ptrNextNode = ptrNextNode->ptrNext;
|
||||||
dwCount++;
|
dwCount++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue