From: James Jones Date: Fri, 29 Apr 2022 19:14:50 +0000 (-0500) Subject: Move use of name after NULL check in dict_by_protocol_substr (CID #1503920) (#4481) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=759ae6e5a7856bfd49f8d7d1878557200c9d3245;p=thirdparty%2Ffreeradius-server.git Move use of name after NULL check in dict_by_protocol_substr (CID #1503920) (#4481) --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 5bb9234ed9a..75f5f21f7cd 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -1957,13 +1957,15 @@ ssize_t dict_by_protocol_substr(fr_dict_attr_err_t *err, fr_dict_t *dict; size_t len; char buffer[FR_DICT_ATTR_MAX_NAME_LEN + 1 + 1]; /* +1 \0 +1 for "too long" */ - fr_sbuff_t our_name = FR_SBUFF(name); + fr_sbuff_t our_name; if (!dict_gctx || !name || !out) { if (err) *err = FR_DICT_ATTR_EINVAL; return 0; } + our_name = FR_SBUFF(name); + memset(&root, 0, sizeof(root)); /*