diff options
author | Tormod Volden <debian.tormod@gmail.com> | 2024-07-23 23:51:13 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-12-16 18:34:43 +0000 |
commit | e11a912aa3bd6b3ad69bb90f36f6860de33d846a (patch) | |
tree | 643ac3e8147180245cc30beb1c6d66a12ed0bcdc | |
parent | ef3a1ef397a2677cccd0e3e7f1287f29f0094e17 (diff) | |
download | edk2-e11a912aa3bd6b3ad69bb90f36f6860de33d846a.tar.gz |
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>
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 488129801e..d053b6bb69 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -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);
}
|