summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 9dde9fddfa..e68c978642 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -3894,6 +3894,10 @@ InternalShellIsHexOrDecimalNumber (
Hex = FALSE;
}
+ if ((*String == CHAR_NULL) && LeadingZero) {
+ return (TRUE);
+ }
+
//
// loop through the remaining characters and use the lib function
//
@@ -4041,17 +4045,17 @@ InternalShellStrHexToUint64 (
// Skip the 'X'
//
String++;
+
+ //
+ // there is a space where there should't be
+ //
+ if (*String == L' ') {
+ return (EFI_INVALID_PARAMETER);
+ }
}
Result = 0;
- //
- // there is a space where there should't be
- //
- if (*String == L' ') {
- return (EFI_INVALID_PARAMETER);
- }
-
while (ShellIsHexaDecimalDigitCharacter (*String)) {
//
// If the Hex Number represented by String overflows according