summaryrefslogtreecommitdiff
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-10-11 11:17:46 +0800
committerHao Wu <hao.a.wu@intel.com>2016-11-08 16:37:04 +0800
commit5acc8d3cdd280f00ab316023e1f77dbce6025eb4 (patch)
treea2c5b14ac4ffb903da2c016632b8566c91428004 /BaseTools/Source
parentb3520abde896e5e3f251054092f084580bfcdc37 (diff)
downloadedk2-platforms-5acc8d3cdd280f00ab316023e1f77dbce6025eb4.tar.xz
BaseTools/TianoCompress: Add checks for array access
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source')
-rw-r--r--BaseTools/Source/C/TianoCompress/TianoCompress.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/BaseTools/Source/C/TianoCompress/TianoCompress.c b/BaseTools/Source/C/TianoCompress/TianoCompress.c
index b994d933eb..93cb6c3ac3 100644
--- a/BaseTools/Source/C/TianoCompress/TianoCompress.c
+++ b/BaseTools/Source/C/TianoCompress/TianoCompress.c
@@ -2215,7 +2215,7 @@ Returns:
for (Char = 0; Char < NumOfChar; Char++) {
Len = BitLen[Char];
- if (Len == 0) {
+ if (Len == 0 || Len >= 17) {
continue;
}
@@ -2346,6 +2346,8 @@ Returns:
volatile UINT16 Index;
UINT32 Mask;
+ assert (nn <= NPT);
+
Number = (UINT16) GetBits (Sd, nbit);
if (Number == 0) {