diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 65adc2541639..214e7db94745 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -5081,7 +5081,8 @@ int wma_unified_power_debug_stats_event_handler(void *handle, if (param_buf->num_debug_register > ((WMI_SVC_MSG_MAX_SIZE - sizeof(wmi_pdev_chip_power_stats_event_fixed_param)) / - sizeof(uint32_t))) { + sizeof(uint32_t)) || + param_buf->num_debug_register > param_tlvs->num_debug_registers) { WMA_LOGE("excess payload: LEN num_debug_register:%u", param_buf->num_debug_register); return -EINVAL;