]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PAE: Silence static analyzer warning about NULL pointer dereference
authorRanga Ravuri <rravuri@qti.qualcomm.com>
Mon, 24 Apr 2017 08:38:10 +0000 (11:38 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 24 Apr 2017 08:38:10 +0000 (11:38 +0300)
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 <jouni@qca.qualcomm.com>
src/pae/ieee802_1x_kay.c

index 1d4ed89c065494e49238c2a38d43222a5025b184..ff55f88b89bc8bf84167a5665a4cb363c8eee24c 100644 (file)
@@ -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)