From 469f29fe7647c6dc8975a3c03ea7e181270d44d3 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Fri, 19 Jul 2024 19:29:33 -0400 Subject: [PATCH] MdeModulePkg/VariablePolicyLib: Use wildcard character constant Makes the `#` character used for comparison against wildcard characters in `CHAR16` strings to be prefixed with `L` so the character is treated as a wide character constant. Signed-off-by: Michael Kubacki --- MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c index 768662829d..053b48d90e 100644 --- a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c +++ b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c @@ -178,7 +178,7 @@ IsValidVariablePolicyStructure ( WildcardCount = 0; while (*CheckChar != CHAR_NULL) { // Make sure there aren't excessive wildcards. - if (*CheckChar == '#') { + if (*CheckChar == L'#') { WildcardCount++; if (WildcardCount > MATCH_PRIORITY_MIN) { return FALSE; @@ -263,7 +263,7 @@ EvaluatePolicyMatch ( // Keep going until the end of both strings. while (PolicyName[Index] != CHAR_NULL || VariableName[Index] != CHAR_NULL) { // If we don't have a match... - if ((PolicyName[Index] != VariableName[Index]) || (PolicyName[Index] == '#')) { + if ((PolicyName[Index] != VariableName[Index]) || (PolicyName[Index] == L'#')) { // If this is a numerical wildcard, we can consider // it a match if we alter the priority. if ((PolicyName[Index] == L'#') &&