mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
ShellPkg/UefiShellLib: Only write value if successful conversion
The ShellConvertStringToUint64() function documentation says: "Upon a successful return the value of the conversion." So do not write any value if the conversion failed. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This commit is contained in:
parent
f34a945a80
commit
d63d5884d7
@ -4234,15 +4234,17 @@ ShellConvertStringToUint64 (
|
|||||||
Status = InternalShellStrDecimalToUint64 (Walker, &RetVal, StopAtSpace);
|
Status = InternalShellStrDecimalToUint64 (Walker, &RetVal, StopAtSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Value == NULL) && !EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return (EFI_NOT_FOUND);
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Value != NULL) {
|
if (Value == NULL) {
|
||||||
*Value = RetVal;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Status);
|
*Value = RetVal;
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user