ShellPkg/UefiShellLib: Correct check for empty string

StrSize() will never return zero since it counts the terminating NULL
character.

An empty string will have the storage size of the terminator.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This commit is contained in:
Tormod Volden 2024-07-23 23:51:13 +02:00 committed by mergify[bot]
parent ef3a1ef397
commit e11a912aa3
1 changed files with 2 additions and 2 deletions

View File

@ -4012,7 +4012,7 @@ InternalShellStrHexToUint64 (
UINT64 Result;
BOOLEAN LeadingZero;
if ((String == NULL) || (StrSize (String) == 0) || (Value == NULL)) {
if ((String == NULL) || (StrSize (String) == sizeof (*String)) || (Value == NULL)) {
return (EFI_INVALID_PARAMETER);
}
@ -4116,7 +4116,7 @@ InternalShellStrDecimalToUint64 (
{
UINT64 Result;
if ((String == NULL) || (StrSize (String) == 0) || (Value == NULL)) {
if ((String == NULL) || (StrSize (String) == sizeof (*String)) || (Value == NULL)) {
return (EFI_INVALID_PARAMETER);
}