xcopy: Avoid a potential out of bounds access.
This commit is contained in:
parent
34823028e1
commit
7711f494e3
|
@ -271,11 +271,9 @@ static BOOL XCOPY_ProcessExcludeFile(WCHAR* filename, WCHAR* endOfName) {
|
||||||
EXCLUDELIST *thisEntry;
|
EXCLUDELIST *thisEntry;
|
||||||
int length = lstrlenW(buffer);
|
int length = lstrlenW(buffer);
|
||||||
|
|
||||||
/* Strip CRLF */
|
|
||||||
buffer[length-1] = 0x00;
|
|
||||||
|
|
||||||
/* If more than CRLF */
|
/* If more than CRLF */
|
||||||
if (length > 1) {
|
if (length > 1) {
|
||||||
|
buffer[length-1] = 0; /* strip CRLF */
|
||||||
thisEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCLUDELIST));
|
thisEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCLUDELIST));
|
||||||
thisEntry->next = excludeList;
|
thisEntry->next = excludeList;
|
||||||
excludeList = thisEntry;
|
excludeList = thisEntry;
|
||||||
|
|
Loading…
Reference in New Issue