summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/C
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2019-02-23 17:41:53 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-02-25 08:58:39 +0800
commit8391ffdc15b959a562c8562e896d219693ce2c63 (patch)
tree4a3be7b2a9325e0d07b7f7eabbc0cc94d5f250d6 /BaseTools/Source/C
parent95083f7db57fd5669e7e4c3fa0297e8ff2039562 (diff)
downloadedk2-8391ffdc15b959a562c8562e896d219693ce2c63.tar.gz
edk2-8391ffdc15b959a562c8562e896d219693ce2c63.tar.bz2
edk2-8391ffdc15b959a562c8562e896d219693ce2c63.zip
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>
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r--BaseTools/Source/C/Common/ParseInf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/C/Common/ParseInf.c b/BaseTools/Source/C/Common/ParseInf.c
index 3907f44331..c5d79c89fa 100644
--- a/BaseTools/Source/C/Common/ParseInf.c
+++ b/BaseTools/Source/C/Common/ParseInf.c
@@ -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] == ' ') {