From: Alan T. DeKok Date: Wed, 17 May 2017 15:39:07 +0000 (-0400) Subject: check before dereference. Found by PVS-Studio X-Git-Tag: release_3_0_14~25 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=60d00043e43d01b41aa21b6d7e905469eccab9c1 check before dereference. Found by PVS-Studio --- diff --git a/src/modules/rlm_eap/libeap/eap_tls.c b/src/modules/rlm_eap/libeap/eap_tls.c index fadc72c..a08cd50 100644 --- a/src/modules/rlm_eap/libeap/eap_tls.c +++ b/src/modules/rlm_eap/libeap/eap_tls.c @@ -325,13 +325,15 @@ static fr_tls_status_t eaptls_verify(eap_handler_t *handler) if (prev_eap_ds && prev_eap_ds->response) eaptls_prev = (eaptls_packet_t *)prev_eap_ds->response->type.data; - /* - * First output the flags (for debugging) - */ - RDEBUG3("Peer sent flags %c%c%c", - TLS_START(eaptls_packet->flags) ? 'S' : '-', - TLS_MORE_FRAGMENTS(eaptls_packet->flags) ? 'M' : '-', - TLS_LENGTH_INCLUDED(eaptls_packet->flags) ? 'L' : '-'); + if (eaptls_packet) { + /* + * First output the flags (for debugging) + */ + RDEBUG3("Peer sent flags %c%c%c", + TLS_START(eaptls_packet->flags) ? 'S' : '-', + TLS_MORE_FRAGMENTS(eaptls_packet->flags) ? 'M' : '-', + TLS_LENGTH_INCLUDED(eaptls_packet->flags) ? 'L' : '-'); + } /* * check for ACK