mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 08:24:16 +09:00
[winpr,path] fix missing length check
This commit is contained in:
@@ -28,8 +28,10 @@ HRESULT PATH_CCH_APPEND(PWSTR pszPath, size_t cchPath, PCWSTR pszMore)
|
||||
const size_t pszMoreLength = _wcsnlen(pszMore, cchPath);
|
||||
const size_t pszPathLength = _wcsnlen(pszPath, cchPath);
|
||||
|
||||
const BOOL pathBackslash =
|
||||
(pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
|
||||
BOOL pathBackslash = FALSE;
|
||||
if (pszPathLength > 0)
|
||||
pathBackslash = (pszPath[pszPathLength - 1] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
|
||||
|
||||
const BOOL moreBackslash = (pszMore[0] == CUR_PATH_SEPARATOR_CHR) ? TRUE : FALSE;
|
||||
|
||||
if (pathBackslash && moreBackslash)
|
||||
|
||||
Reference in New Issue
Block a user