BaseTools: Add parameter check for the AsciiStringToUint64

If the input parameter AsciiString length is greater
than 255, the GenFv will hang.

This patch is to fix this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Feng, Bob C 2019-02-23 17:41:53 +08:00
parent 95083f7db5
commit 8391ffdc15
1 changed files with 1 additions and 1 deletions

View File

@ -508,7 +508,7 @@ Returns:
//
// Check input parameter
//
if (AsciiString == NULL || ReturnValue == NULL) {
if (AsciiString == NULL || ReturnValue == NULL || strlen(AsciiString) > 0xFF) {
return EFI_INVALID_PARAMETER;
}
while (AsciiString[Index] == ' ') {