From: Arran Cudbard-Bell Date: Sat, 16 Mar 2024 00:32:21 +0000 (-0400) Subject: Check we actually allocated an attribute X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e76e84d0930c2032907c1a8558ee0a2bbb4902d6;p=thirdparty%2Ffreeradius-server.git Check we actually allocated an attribute --- diff --git a/src/process/dns/base.c b/src/process/dns/base.c index 9b00018dd79..5a97bfdfa4c 100644 --- a/src/process/dns/base.c +++ b/src/process/dns/base.c @@ -350,6 +350,7 @@ static inline CC_HINT(always_inline) void dns_rcode_add(fr_pair_t **rcode, request_t *request, fr_value_box_t const **code) { fr_value_box_t const *vb; + int ret; if (!code || !*code) return; @@ -359,7 +360,8 @@ void dns_rcode_add(fr_pair_t **rcode, request_t *request, fr_value_box_t const * * Don't override the user status * code. */ - if (fr_pair_update_by_da_parent(request->reply_ctx, rcode, attr_rcode) == 0) { + MEM((ret = fr_pair_update_by_da_parent(request->reply_ctx, rcode, attr_rcode)) >= 0); + if (ret == 0) { fr_value_box_copy(*rcode, &(*rcode)->data, vb); (*rcode)->data.enumv = (*rcode)->da; /* Hack, boxes should have their enumv field populated */ }