]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
header is at least 4 bytes
authorAlan T. DeKok <aland@freeradius.org>
Thu, 21 Jan 2021 20:29:39 +0000 (15:29 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 21 Jan 2021 20:29:39 +0000 (15:29 -0500)
src/protocols/dhcpv6/base.c

index ed5b4a35fbd2068b76f6b1df44f8045f814fa2c8..bd2281e6e7718eb32eb553a383c9d1dbe30822bb 100644 (file)
@@ -637,7 +637,7 @@ ssize_t     fr_dhcpv6_decode(TALLOC_CTX *ctx, uint8_t const *packet, size_t packet_l
        fr_dhcpv6_decode_ctx_t  packet_ctx;
        fr_pair_t               *vp;
 
-       if (!packet_len) return 0; /* protect access to packet[0] */
+       if (packet_len < DHCPV6_HDR_LEN) return 0; /* protect access to packet[0] */
 
        /*
         *      Get the packet type.