Module: wine Branch: master Commit: 7711f494e39432984b177e0a18a204dd75bc4cb1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7711f494e39432984b177e0a18...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Oct 27 17:46:38 2014 +0900
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 7ff751c..2134a5e 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;