Merge "Wlan: Use proper length to copy channel avoid ind in WDI from FW"
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi.c b/CORE/WDI/CP/src/wlan_qct_wdi.c
index 3aaf0f1..067f275 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi.c
@@ -31034,6 +31034,7 @@
   WDI_LowLevelIndType  wdiInd;
   tHalAvoidFreqRangeIndParams chAvoidIndicationParam;
   wpt_uint16           rangeLoop;
+  wpt_uint32           dataSize;
   /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
   /*-------------------------------------------------------------------------
@@ -31048,12 +31049,16 @@
      return WDI_STATUS_E_FAILURE;
   }
 
+  dataSize = sizeof(tHalAvoidFreqRangeIndParams);
+  if (dataSize > pEventData->uEventDataSize)
+    dataSize = pEventData->uEventDataSize;
+
   /*-------------------------------------------------------------------------
   Extract indication and send it to UMAC
  -------------------------------------------------------------------------*/
   wpalMemoryCopy(&chAvoidIndicationParam,
                  pEventData->pEventData,
-                 sizeof(tHalAvoidFreqRangeIndParams));
+                 dataSize);
 
   /* Avoid Over flow */
   if (WLAN_HAL_MAX_AVOID_FREQ_RANGE < chAvoidIndicationParam.avoidCnt)