From: Alan T. DeKok Date: Tue, 13 Dec 2022 19:34:46 +0000 (-0500) Subject: our_parent cannot be NULL here X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09d041bfc0d8491019056e65522fb1199569f95f;p=thirdparty%2Ffreeradius-server.git our_parent cannot be NULL here --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 2cce8872dac..7cef075db4e 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -1652,6 +1652,8 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t * reference. */ if (da) { + fr_assert(our_parent != NULL); + MEM(ar = talloc(ctx, tmpl_attr_t)); *ar = (tmpl_attr_t){ .ar_num = NUM_UNSPEC, @@ -1686,6 +1688,8 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t goto error; } + fr_assert(our_parent != NULL); + /* * See if the ref begins with an unsigned integer * if it does it's probably an OID component @@ -1750,7 +1754,7 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t /* * Inherit the internal flag from our parent. */ - da_unknown->flags.internal = (parent == NULL) || parent->flags.internal; + da_unknown->flags.internal = our_parent->flags.internal; *ar = (tmpl_attr_t){ .ar_num = NUM_UNSPEC,