summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2024-07-23 23:51:13 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-16 18:34:43 +0000
commite11a912aa3bd6b3ad69bb90f36f6860de33d846a (patch)
tree643ac3e8147180245cc30beb1c6d66a12ed0bcdc
parentef3a1ef397a2677cccd0e3e7f1287f29f0094e17 (diff)
downloadedk2-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.c4
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);
}