]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
turn assert into run-time check. Fixes #3008
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Sep 2019 17:16:18 +0000 (13:16 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Sep 2019 17:21:53 +0000 (13:21 -0400)
src/lib/server/cf_parse.c

index 1c05d5935a378b32b106e56a7689539bce15bc3a..dfed273a33dcd3db4acf60116966a5d7971fce1a 100644 (file)
@@ -153,12 +153,18 @@ int cf_pair_parse_value(TALLOC_CTX *ctx, void *out, UNUSED void *base, CONF_ITEM
                return -1;
        }
 
-       rad_assert(cp->value);
+       /*
+        *      Catch crazy errors.
+        */
+       if (!cp->value) {
+               cf_log_err(cp, "Configuration pair \"%s\" must have a value", cf_pair_attr(cp));
+               return -1;
+       }
 
        /*
         *      Check for zero length strings
         */
-       if (((!cp->value || cp->value[0] == '\0')) && cant_be_empty) {
+       if ((cp->value[0] == '\0') && cant_be_empty) {
                cf_log_err(cp, "Configuration pair \"%s\" must not be empty (zero length)", cf_pair_attr(cp));
                if (!required) cf_log_err(cp, "Comment item to silence this message");
                rcode = -1;