]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
cp->value can be NULL. Fixes #3008
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Sep 2019 14:12:11 +0000 (10:12 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Sep 2019 14:12:35 +0000 (10:12 -0400)
src/lib/server/cf_parse.c

index 5c35f8a9ac59e5fecb19047184edfb4f3fae229c..1c05d5935a378b32b106e56a7689539bce15bc3a 100644 (file)
@@ -158,7 +158,7 @@ int cf_pair_parse_value(TALLOC_CTX *ctx, void *out, UNUSED void *base, CONF_ITEM
        /*
         *      Check for zero length strings
         */
-       if ((cp->value[0] == '\0') && cant_be_empty) {
+       if (((!cp->value || 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;