[misc] fix PVS-Studio warnings

This commit is contained in:
Pete Batard 2022-01-05 12:57:26 +01:00
parent eeca1f279c
commit c28f9bc491
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
26 changed files with 98 additions and 81 deletions

View file

@ -821,7 +821,7 @@ static __inline int SHDeleteDirectoryExU(HWND hwnd, const char* pszPath, FILEOP_
int ret;
// String needs to be double NULL terminated, so we just use the length of the UTF-8 string
// which is always expected to be larger than our UTF-16 one, and add 2 chars for good measure.
size_t wpszPath_len = strlen(pszPath) + 2;
size_t wpszPath_len = (pszPath == NULL) ? 0 : strlen(pszPath) + 2;
// coverity[returned_null]
walloc(pszPath, wpszPath_len);
SHFILEOPSTRUCTW shfo = { hwnd, FO_DELETE, wpszPath, NULL, fFlags, FALSE, NULL, NULL };