From: Alan T. DeKok Date: Thu, 19 Oct 2023 21:30:41 +0000 (-0400) Subject: parse-time errors are better than run-time asserts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c4862c5dcd90a7484196c8cfe5aa8888a81ccfa;p=thirdparty%2Ffreeradius-server.git parse-time errors are better than run-time asserts we don't support structural types on the RHS of maps, so don't even try to parse them. Just return an error --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index 09d05be3aa9..8ff0c79a3c6 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -581,6 +581,10 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf */ if (map->op == T_OP_CMP_TRUE) goto parse_rhs; + fr_strerror_const("Structural attributes are not supported"); + goto error; + +#if 0 /* * @todo - check for, and allow '&' * attribute references. If found, then @@ -621,6 +625,7 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf * of the RHS parsing. */ goto check_for_child; +#endif default: break; @@ -709,7 +714,9 @@ parse_rhs: } } +#if 0 check_for_child: +#endif /* * Add this map to to the parents list. Note that the * caller will have to check for this!