Author: tkreuzer Date: Thu Dec 31 15:44:33 2009 New Revision: 44824
URL: http://svn.reactos.org/svn/reactos?rev=44824&view=rev Log: Patch by Amine Khaldi: Fix buffer length check
Modified: trunk/reactos/base/applications/cacls/cacls.c
Modified: trunk/reactos/base/applications/cacls/cacls.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cacls/cac... ============================================================================== --- trunk/reactos/base/applications/cacls/cacls.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cacls/cacls.c [iso-8859-1] Thu Dec 31 15:44:33 2009 @@ -180,14 +180,14 @@ PrintFileDacl(IN LPTSTR FilePath, IN LPTSTR FileName) { - SIZE_T Indent; + SIZE_T Length; PSECURITY_DESCRIPTOR SecurityDescriptor; DWORD SDSize = 0; TCHAR FullFileName[MAX_PATH + 1]; BOOL Error = FALSE, Ret = FALSE;
- Indent = _tcslen(FilePath) + _tcslen(FileName); - if (Indent++ > MAX_PATH - 1) + Length = _tcslen(FilePath) + _tcslen(FileName); + if (Length > MAX_PATH) { /* file name too long */ SetLastError(ERROR_FILE_NOT_FOUND);