check before dereference. Found by PVS-Studio
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 May 2017 15:39:07 +0000 (11:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 19 May 2017 18:06:53 +0000 (14:06 -0400)
src/modules/rlm_eap/libeap/eap_tls.c

index fadc72c..a08cd50 100644 (file)
@@ -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