xcopy: Avoid a potential out of bounds access.

This commit is contained in:
Alexandre Julliard 2014-10-27 17:46:38 +09:00
parent 34823028e1
commit 7711f494e3
1 changed files with 1 additions and 3 deletions

View File

@ -271,11 +271,9 @@ static BOOL XCOPY_ProcessExcludeFile(WCHAR* filename, WCHAR* endOfName) {
EXCLUDELIST *thisEntry;
int length = lstrlenW(buffer);
/* Strip CRLF */
buffer[length-1] = 0x00;
/* If more than CRLF */
if (length > 1) {
buffer[length-1] = 0; /* strip CRLF */
thisEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(EXCLUDELIST));
thisEntry->next = excludeList;
excludeList = thisEntry;