Selaa lähdekoodia

qcacld-3.0: Fix null pointer dereference in __lim_process_gid_management_action_frame

In __lim_process_gid_management_action_frame function dph_lookup_hash_entry
may return NULL, So validate return type to avoid null pointer dereference.

Change-Id: I7d66f61bb26017ed4ffdd3435520b68623dda55a
CRs-Fixed: 1082162
(cherry picked from commit 86a1d429d9114f982dd837c4d2527f154261c459)
Arif Hussain 8 vuotta sitten
vanhempi
sitoutus
4a682396cb
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      core/mac/src/pe/lim/lim_process_action_frame.c

+ 5 - 0
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -636,6 +636,11 @@ static void __lim_process_gid_management_action_frame(tpAniSirGlobal mac_ctx,
 	}
 	sta_ptr = dph_lookup_hash_entry(mac_ctx, mac_hdr->sa, &aid,
 			&session->dph.dphHashTable);
+	if (!sta_ptr) {
+		lim_log(mac_ctx, LOGE,
+			FL("Failed to get STA entry from hash table"));
+		goto out;
+	}
 	lim_log(mac_ctx, LOGE,
 		FL("received Gid Management Action Frame , staIdx = %d"),
 		sta_ptr->staIndex);