]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
we want the length of the uint8_t data, not eap_packet_raw_t
authorAlan T. DeKok <aland@freeradius.org>
Mon, 29 May 2017 15:26:00 +0000 (11:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 29 May 2017 15:26:00 +0000 (11:26 -0400)
src/modules/rlm_eap/eap.c

index b61a2401404d1f6179cf4c859f79475860f04f9d..12d3ea16983333567b62a309d7fb2b46272ac196 100644 (file)
@@ -510,8 +510,9 @@ static int eap_validation(REQUEST *request, eap_packet_raw_t **eap_packet_p)
         *      but that's OK.  The static analysis tools aren't smart
         *      enough to figure that out.
         */
-       packet_len = talloc_array_length(*eap_packet_p);
-       if (packet_len < EAP_HEADER_LEN) {
+       packet_len = talloc_array_length((uint8_t *) eap_packet);
+       if (packet_len <= EAP_HEADER_LEN) {
+               REDEBUG("Invalid EAP data lenth %zd <= 4", packet_len);
                return -1;
        }