]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check option length correctly
authorAlan T. DeKok <aland@freeradius.org>
Wed, 30 Oct 2019 18:11:04 +0000 (14:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 30 Oct 2019 18:11:04 +0000 (14:11 -0400)
src/protocols/dhcpv4/decode.c

index 54f3c6f391ff46bc1dc3d74c37b7d3e14470624b..c25baf6bba4b09ae36ada8e448d59a22bf4761b2 100644 (file)
@@ -396,7 +396,7 @@ ssize_t fr_dhcpv4_decode_option(TALLOC_CTX *ctx, fr_cursor_t *cursor,
        /*
         *      Everything else should be real options
         */
-       if ((data_len < 2) || (data[1] > data_len)) {
+       if ((data_len < 2) || ((data[1] + 2) > data_len)) {
                fr_strerror_printf("%s: Insufficient data", __FUNCTION__);
                return -1;
        }