Skip to content

Commit

Permalink
config_format: yaml: fix null dereference
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored and edsiper committed Aug 31, 2023
1 parent 7eb03a3 commit 61dc9aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/config_format/flb_cf_yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,13 +1285,13 @@ static int consume_event(struct flb_cf *conf, struct local_ctx *ctx,
break;
case YAML_SEQUENCE_START_EVENT: /* start a new group */

if (strcmp(state->key, "processors") == 0) {
yaml_error_event(ctx, state, event);
if (state->key == NULL) {
flb_error("no key");
return YAML_FAILURE;
}

if (state->key == NULL) {
flb_error("no key");
if (strcmp(state->key, "processors") == 0) {
yaml_error_event(ctx, state, event);
return YAML_FAILURE;
}

Expand Down

0 comments on commit 61dc9aa

Please sign in to comment.