qcacmn: Add NULL check for find IE API
Ensure that the IE pointer is not dereferenced if the pointer passed to the function is NULL. CRs-Fixed: 2724504 Change-Id: Ie6b4c633e252de5162c9f7ab72c2ea4a2cc058dd
This commit is contained in:
@@ -1651,13 +1651,15 @@ util_scan_gen_scan_entry(struct wlan_objmgr_pdev *pdev,
|
|||||||
* @ies: pointer consisting of IEs
|
* @ies: pointer consisting of IEs
|
||||||
* @len: IE length
|
* @len: IE length
|
||||||
*
|
*
|
||||||
* Return: NULL if the element ID is not found or
|
* Return: NULL if the element ID is not found or if IE pointer is NULL else
|
||||||
* a pointer to the first byte of the requested
|
* pointer to the first byte of the requested element
|
||||||
* element
|
|
||||||
*/
|
*/
|
||||||
static uint8_t *util_scan_find_ie(uint8_t eid, uint8_t *ies,
|
static uint8_t *util_scan_find_ie(uint8_t eid, uint8_t *ies,
|
||||||
int32_t len)
|
int32_t len)
|
||||||
{
|
{
|
||||||
|
if (!ies)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
while (len >= 2 && len >= ies[1] + 2) {
|
while (len >= 2 && len >= ies[1] + 2) {
|
||||||
if (ies[0] == eid)
|
if (ies[0] == eid)
|
||||||
return ies;
|
return ies;
|
||||||
|
Reference in New Issue
Block a user