diff options
| author | Yun Park <yunp@codeaurora.org> | 2017-02-10 10:34:57 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-02-13 16:19:52 -0800 |
| commit | 0ec7a9fcdf7ce38b27d2063be96591f352ebaac7 (patch) | |
| tree | af9066a89999bc00d40fe1e553722e81de115f9d | |
| parent | 7ba4ab627c7175ed8b113526b6ec7cb995201c2f (diff) | |
qcacld-3.0: Remove op_string enum to avoid out of bounds access
Fix potential buffer overflow by array index out of bounds.
We need to add a new op_string entry whenever a new opcode added.
Otherwise, the op_string entry for the additional opcodes could
be accessed out-of-bounds.
Change-Id: Ic09b19916b63d8bb83bf278361b8519268ee1787
CRs-Fixed: 2005340
| -rw-r--r-- | core/hdd/src/wlan_hdd_ipa.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 53b929bc9cea..21b42ec4d001 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -616,19 +616,6 @@ static struct hdd_ipa_tx_hdr ipa_tx_hdr = { } }; -static const char *op_string[] = { - "TX_SUSPEND", - "TX_RESUME", - "RX_SUSPEND", - "RX_RESUME", - "STATS", -#ifdef FEATURE_METERING - "SHARING_STATS", - "QUOTA_RSP", - "QUOTA_IND", -#endif -}; - #ifdef FEATURE_METERING #define IPA_UC_SHARING_STATES_WAIT_TIME 500 #define IPA_UC_SET_QUOTA_WAIT_TIME 500 @@ -2070,7 +2057,7 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa; HDD_IPA_DP_LOG(QDF_TRACE_LEVEL_DEBUG, - "OPCODE %s", op_string[msg->op_code]); + "OPCODE=%d", msg->op_code); if ((HDD_IPA_UC_OPCODE_TX_RESUME == msg->op_code) || (HDD_IPA_UC_OPCODE_RX_RESUME == msg->op_code)) { |
