From 9f894823fa3d538e83bf5b5e4f683181350ac8b8 Mon Sep 17 00:00:00 2001 From: Ranga Ravuri Date: Mon, 24 Apr 2017 11:38:10 +0300 Subject: [PATCH] PAE: Silence static analyzer warning about NULL pointer dereference ieee802_1x_kay_move_live_peer() did not check ieee802_1x_kay_get_potential_peer() result explicitly and a static analyzer reported a warning about the possible NULL result. This cannot really happen in practice since the only caller of ieee802_1x_kay_move_live_peer() verifies that the specific peer entry is available. Anyway, it is easy to silence the false warning by adding an explicit check here and cover any other potential case if another caller is added. Signed-off-by: Jouni Malinen --- src/pae/ieee802_1x_kay.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c index 1d4ed89c0..ff55f88b8 100644 --- a/src/pae/ieee802_1x_kay.c +++ b/src/pae/ieee802_1x_kay.c @@ -633,6 +633,8 @@ ieee802_1x_kay_move_live_peer(struct ieee802_1x_mka_participant *participant, struct receive_sc *rxsc; peer = ieee802_1x_kay_get_potential_peer(participant, mi); + if (!peer) + return NULL; rxsc = ieee802_1x_kay_init_receive_sc(&participant->current_peer_sci); if (!rxsc)