mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
Revert "qcacld-3.0: Fix OOB write in wma_unified_debug_print_event_handler"
The change for the CR 2211133 caused compilation issue in LE branches. This reverts commit with change Id-I45943ae76d8fcf7b53e1f064c462d01cd6d00dcf Change-Id: I069f1a4ae8ad320f5a073ee072dd772e05c5fc5d CRs-Fixed: 2222536
This commit is contained in:
parent
fd91a0df0f
commit
71596f796d
1 changed files with 6 additions and 18 deletions
|
|
@ -3525,43 +3525,31 @@ int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap,
|
|||
WMI_DEBUG_PRINT_EVENTID_param_tlvs *param_buf;
|
||||
uint8_t *data;
|
||||
uint32_t datalen;
|
||||
char dbgbuf[WMI_SVC_MSG_MAX_SIZE] = { 0 };
|
||||
|
||||
param_buf = (WMI_DEBUG_PRINT_EVENTID_param_tlvs *) datap;
|
||||
if (!param_buf || !param_buf->data) {
|
||||
if (!param_buf) {
|
||||
WMA_LOGE("Get NULL point message from FW");
|
||||
return -ENOMEM;
|
||||
}
|
||||
data = param_buf->data;
|
||||
datalen = param_buf->num_data;
|
||||
if (datalen > WMI_SVC_MSG_MAX_SIZE) {
|
||||
WMA_LOGE("Received data len %d exceeds max value %d",
|
||||
datalen, WMI_SVC_MSG_MAX_SIZE);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef BIG_ENDIAN_HOST
|
||||
{
|
||||
if (datalen >= BIG_ENDIAN_MAX_DEBUG_BUF) {
|
||||
if (datalen > BIG_ENDIAN_MAX_DEBUG_BUF) {
|
||||
WMA_LOGE("%s Invalid data len %d, limiting to max",
|
||||
__func__, datalen);
|
||||
datalen = BIG_ENDIAN_MAX_DEBUG_BUF-1;
|
||||
datalen = BIG_ENDIAN_MAX_DEBUG_BUF;
|
||||
}
|
||||
char dbgbuf[BIG_ENDIAN_MAX_DEBUG_BUF] = { 0 };
|
||||
|
||||
strlcpy(dbgbuf, data, datalen);
|
||||
memcpy(dbgbuf, data, datalen);
|
||||
SWAPME(dbgbuf, datalen);
|
||||
WMA_LOGD("FIRMWARE:%s", dbgbuf);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
if (datalen == WMI_SVC_MSG_MAX_SIZE) {
|
||||
WMA_LOGE("%s Invalid data len %d, limiting to max",
|
||||
__func__, datalen);
|
||||
datalen = WMI_SVC_MSG_MAX_SIZE -1 ;
|
||||
}
|
||||
|
||||
strlcpy(dbgbuf, data, datalen);
|
||||
WMA_LOGD("FIRMWARE:%s", dbgbuf);
|
||||
WMA_LOGD("FIRMWARE:%s", data);
|
||||
return 0;
|
||||
#endif /* BIG_ENDIAN_HOST */
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue