From 7711f494e39432984b177e0a18a204dd75bc4cb1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 27 Oct 2014 17:46:38 +0900 Subject: [PATCH] xcopy: Avoid a potential out of bounds access. --- programs/xcopy/xcopy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/programs/xcopy/xcopy.c b/programs/xcopy/xcopy.c index 7ff751c2014..2134a5eae77 100644 --- a/programs/xcopy/xcopy.c +++ b/programs/xcopy/xcopy.c @@ -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;