diff options
| author | Mohammed Javid <mjavid@codeaurora.org> | 2018-04-05 19:26:42 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-04-16 11:09:58 -0700 |
| commit | b572adf65522c587964bacbc1c4623212d8040fd (patch) | |
| tree | 19a94bef9497071faadcbca28dee9f3589cf989b | |
| parent | 01d65867452337d7f99048e2cd200cb9bf6543d1 (diff) | |
ipacm: Fix KW issue
Add check to prevent access of invalid
array index.
Change-Id: I95fbb1992a944b91f31e7bb1ee4bf5642d7e31fd
| -rw-r--r-- | ipacm/src/IPACM_Lan.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp index 871b957..71b397b 100644 --- a/ipacm/src/IPACM_Lan.cpp +++ b/ipacm/src/IPACM_Lan.cpp @@ -3331,7 +3331,8 @@ int IPACM_Lan::handle_uplink_filter_rule(ipacm_ext_prop *prop, ipa_ip_type iptyp #ifdef FEATURE_IPACM_HAL /* add prefix equation in modem UL rules */ - if(iptype == IPA_IP_v4 && flt_rule_entry.rule.eq_attrib.num_offset_meq_32 < IPA_IPFLTR_NUM_MEQ_32_EQNS) + if(iptype == IPA_IP_v4 && (flt_rule_entry.rule.eq_attrib.num_offset_meq_32 >= 0) + && (flt_rule_entry.rule.eq_attrib.num_offset_meq_32 < IPA_IPFLTR_NUM_MEQ_32_EQNS)) { flt_rule_entry.rule.eq_attrib.num_offset_meq_32++; eq_index = flt_rule_entry.rule.eq_attrib.num_offset_meq_32 - 1; @@ -3365,7 +3366,9 @@ int IPACM_Lan::handle_uplink_filter_rule(ipacm_ext_prop *prop, ipa_ip_type iptyp } else { - if (flt_rule_entry.rule.eq_attrib.num_offset_meq_128 < IPA_IPFLTR_NUM_MEQ_128_EQNS) + if ((flt_rule_entry.rule.eq_attrib.num_offset_meq_128 >= 0) && + (flt_rule_entry.rule.eq_attrib.num_offset_meq_128 + < IPA_IPFLTR_NUM_MEQ_128_EQNS)) { flt_rule_entry.rule.eq_attrib.num_offset_meq_128++; eq_index = flt_rule_entry.rule.eq_attrib.num_offset_meq_128 - 1; |
