Skip to content
Permalink
Browse files

don't dereference NULL

  • Loading branch information...
alandekok committed May 14, 2019
1 parent 41e8aed commit f6ba65bb279e69f4b901e2867588f34e15b95b6f
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/lib/util/dict.c
@@ -4139,8 +4139,13 @@ static int dict_read_process_member(dict_from_file_ctx_t *ctx, char **argv, int
return -1;
}

if (!ctx->previous_attr || (ctx->previous_attr->type != FR_TYPE_STRUCT)) {
fr_strerror_printf("MEMBER can only be used for ATTRIBUTES of type 'struct', not %s", ctx->previous_attr->name);
if (!ctx->previous_attr) {
fr_strerror_printf("MEMBER can only be used immediately after an ATTRIBUTE definition");
return -1;
}

if (ctx->previous_attr->type != FR_TYPE_STRUCT) {
fr_strerror_printf("MEMBER can only be used for ATTRIBUTEs of type 'struct', not %s", ctx->previous_attr->name);
return -1;
}

0 comments on commit f6ba65b

Please sign in to comment.
You can’t perform that action at this time.