peview: Fix assert allocating selected certificate lists
* Process Hacker -
* PE viewer
*
- * Copyright (C) 2020 dmex
+ * Copyright (C) 2020-2021 dmex
*
* This file is part of Process Hacker.
*
@@ -149,11 +149,11 @@ static BOOLEAN WordMatchStringRef(
while (remainingPart.Length)
{
- PhSplitStringRefAtChar(&remainingPart, '|', &part, &remainingPart);
+ PhSplitStringRefAtChar(&remainingPart, L'|', &part, &remainingPart);
if (part.Length)
{
- if (PhFindStringInStringRef(Text, &part, TRUE) != -1)
+ if (PhFindStringInStringRef(Text, &part, TRUE) != SIZE_MAX)
return TRUE;
}
}
@@ -778,8 +778,11 @@ VOID PvGetSelectedCertificateNodes(
}
}
+ if (list->Count)
+ {
*Windows = PhAllocateCopy(list->Items, sizeof(PVOID) * list->Count);
*NumberOfWindows = list->Count;
+ }
PhDereferenceObject(list);
}
