From: Nick Porter Date: Fri, 4 Oct 2024 10:11:25 +0000 (+0100) Subject: Padding is correctly handled by fr_dhcpv4_decode_option() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7df5b3571fd9bfdaae74017aa389f5ba2f6036c2;p=thirdparty%2Ffreeradius-server.git Padding is correctly handled by fr_dhcpv4_decode_option() --- diff --git a/src/protocols/dhcpv4/packet.c b/src/protocols/dhcpv4/packet.c index bb142c503ae..c17c3ec21b5 100644 --- a/src/protocols/dhcpv4/packet.c +++ b/src/protocols/dhcpv4/packet.c @@ -194,8 +194,6 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, * Loop over all the options data */ while (p < end) { - if (p[0] == 0) break; /* padding */ - len = fr_dhcpv4_decode_option(ctx, &tmp, p, (end - p), packet_ctx); if (len <= 0) { fail: @@ -227,8 +225,6 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, p = data + 44; end = p + 64; while (p < end) { - if (p[0] == 0) break; /* padding */ - len = fr_dhcpv4_decode_option(ctx, &tmp, p, end - p, packet_ctx); if (len <= 0) goto fail; @@ -243,8 +239,6 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, p = data + 108; end = p + 128; while (p < end) { - if (p[0] == 0) break; /* padding */ - len = fr_dhcpv4_decode_option(ctx, &tmp, p, end - p, packet_ctx); if (len <= 0) goto fail;