From: Sabrina Dubroca Date: Tue, 19 Jul 2016 09:56:55 +0000 (+0200) Subject: mka: Add error handling around ieee802_1x_kay_move_live_peer() X-Git-Tag: hostap_2_6~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac285c007cfd20e81492ed087f8a6cf349fb8f7a;p=thirdparty%2Fhostap.git mka: Add error handling around ieee802_1x_kay_move_live_peer() ieee802_1x_kay_move_live_peer() can fail. In that case, we should not proceed. Signed-off-by: Sabrina Dubroca --- diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c index bb2becd49..c1e6b31ec 100644 --- a/src/pae/ieee802_1x_kay.c +++ b/src/pae/ieee802_1x_kay.c @@ -3018,9 +3018,12 @@ static int ieee802_1x_kay_decode_mkpdu(struct ieee802_1x_kay *kay, } if (ieee802_1x_kay_is_in_potential_peer( participant, participant->current_peer_id.mi)) { - ieee802_1x_kay_move_live_peer( - participant, participant->current_peer_id.mi, - be_to_host32(participant->current_peer_id.mn)); + if (!ieee802_1x_kay_move_live_peer( + participant, + participant->current_peer_id.mi, + be_to_host32(participant-> + current_peer_id.mn))) + return -1; ieee802_1x_kay_elect_key_server(participant); ieee802_1x_kay_decide_macsec_use(participant); }