diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2020-08-06 12:05:38 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-08-07 02:30:01 +0000 |
commit | 86652264641337d960275514056ec94613ecda24 (patch) | |
tree | 6d043b4a0d042251b115c657174b76f77feaf903 /FmpDevicePkg | |
parent | c2db6a86a25508725db8018c62dd39f92ae6ee79 (diff) | |
download | edk2-86652264641337d960275514056ec94613ecda24.tar.gz edk2-86652264641337d960275514056ec94613ecda24.tar.bz2 edk2-86652264641337d960275514056ec94613ecda24.zip |
FmpDevicePkg/FmpDependencyLib: Handle version string overflow
This change recognizes the condition of the DEPEX version string
extending beyond the end of the dependency expression as an error.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Cc: Wei6 Xu <wei6.xu@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Wei6 Xu <wei6.xu@intel.com>
Diffstat (limited to 'FmpDevicePkg')
-rw-r--r-- | FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c index ba89eb22d9..5ef25d2415 100644 --- a/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c +++ b/FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.c @@ -286,6 +286,7 @@ EvaluateDependency ( Iterator += AsciiStrnLenS ((CHAR8 *) Iterator, DependenciesSize - (Iterator - Dependencies->Dependencies));
if (Iterator == (UINT8 *) Dependencies->Dependencies + DependenciesSize) {
DEBUG ((DEBUG_ERROR, "EvaluateDependency: STRING extends beyond end of dependency expression!\n"));
+ goto Error;
}
break;
case EFI_FMP_DEP_AND:
|