diff options
author | Mohammed Javid <mjavid@codeaurora.org> | 2018-04-05 19:26:42 +0530 |
---|---|---|
committer | Cosme Domínguez Díaz <cosme.ddiaz@gmail.com> | 2018-06-29 23:26:00 +0200 |
commit | 984646e4b590e06d7913b8ec60e90e9b6b49daaf (patch) | |
tree | 235af0cbdd214de7ea99c352698d5911f4f10a5e /data-ipa-cfg-mgr/ipacm/src | |
parent | b6c75d8d2fd47ff5df921eee56612f4b759b65a1 (diff) |
ipacm: Fix KW issue
Add check to prevent access of invalid
array index.
Change-Id: I95fbb1992a944b91f31e7bb1ee4bf5642d7e31fd
Diffstat (limited to 'data-ipa-cfg-mgr/ipacm/src')
-rw-r--r-- | data-ipa-cfg-mgr/ipacm/src/IPACM_Lan.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/data-ipa-cfg-mgr/ipacm/src/IPACM_Lan.cpp b/data-ipa-cfg-mgr/ipacm/src/IPACM_Lan.cpp index 4aad1ef..0391fbe 100644 --- a/data-ipa-cfg-mgr/ipacm/src/IPACM_Lan.cpp +++ b/data-ipa-cfg-mgr/ipacm/src/IPACM_Lan.cpp @@ -3262,7 +3262,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; @@ -3296,7 +3297,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; |