From: Alan T. DeKok Date: Sat, 9 Oct 2021 17:32:38 +0000 (-0400) Subject: return only as much as we decoded X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22d34a17f31ec2fd8ce867dd5f42056a3f7aaeee;p=thirdparty%2Ffreeradius-server.git return only as much as we decoded which lets TLVs work after structures --- diff --git a/src/lib/util/struct.c b/src/lib/util/struct.c index 877b354e66e..fb85c5b87a4 100644 --- a/src/lib/util/struct.c +++ b/src/lib/util/struct.c @@ -393,13 +393,6 @@ ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_pair_list_t *out, } fr_dict_unknown_free(&child); - - /* - * Else return whatever we decoded. Note that if - * the substruct ends in a TLV, we decode only as - * many TLVs as the various "length" fields say. - */ - data_len = p - data; } done: @@ -412,7 +405,7 @@ done: } FR_PROTO_TRACE("used %zd bytes", data_len); - return data_len; + return p - data; }