From: Alan T. DeKok Date: Sat, 2 Nov 2019 01:40:16 +0000 (-0400) Subject: return that we decoded this option, and only this option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44f07d0b64dbb68849c60ca3c2f6fd847befdd8b;p=thirdparty%2Ffreeradius-server.git return that we decoded this option, and only this option --- diff --git a/src/protocols/dhcpv6/decode.c b/src/protocols/dhcpv6/decode.c index b5390c90e8b..99de771c321 100644 --- a/src/protocols/dhcpv6/decode.c +++ b/src/protocols/dhcpv6/decode.c @@ -377,7 +377,6 @@ static ssize_t decode_options(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dict_t co fr_dict_attr_t const *da; fr_dhcpv6_decode_ctx_t *packet_ctx = decoder_ctx; - #ifdef __clang_analyzer__ if (!packet_ctx || !packet_ctx->tmp_ctx) return -1; #endif @@ -417,9 +416,11 @@ static ssize_t decode_options(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dict_t co } else { rcode = decode_value(ctx, cursor, dict, da, data + 4, len, decoder_ctx); } + if (rcode < 0) return rcode; - return data_len; + return len + 4; + }