From: Alan T. DeKok Date: Mon, 18 Nov 2019 22:07:45 +0000 (-0500) Subject: set "next" appropriately, i.e. to the start of the buffer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6200486b13a898f90d326ff56fea3bf16add8e4e;p=thirdparty%2Ffreeradius-server.git set "next" appropriately, i.e. to the start of the buffer --- diff --git a/src/protocols/dhcpv6/decode.c b/src/protocols/dhcpv6/decode.c index 5c2ccbd2887..79cfcfdd14e 100644 --- a/src/protocols/dhcpv6/decode.c +++ b/src/protocols/dhcpv6/decode.c @@ -267,7 +267,7 @@ static ssize_t decode_dns_labels(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dict_t ssize_t rcode; size_t total; VALUE_PAIR *vp; - uint8_t const *next; + uint8_t const *next = data; FR_PROTO_HEX_DUMP(data, data_len, "decode_dns_labels"); @@ -277,10 +277,12 @@ static ssize_t decode_dns_labels(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dict_t */ if (!parent->flags.array) { rcode = fr_dns_label_length(data, data_len, &next); - if (rcode < 0) goto raw; + if (rcode <= 0) goto raw; /* * If the DNS label doesn't exactly fill the option, it's an error. + * + * @todo - we may want to remove this check. */ if (next != (data + data_len)) goto raw;