From c6fa1cf41b582a9e1b4b485999d9dfb74f966fe5 Mon Sep 17 00:00:00 2001 From: Takahiro Yamashita Date: Fri, 12 Aug 2022 14:12:36 +0900 Subject: [PATCH] record_accessor: add NULL check(#5846) Signed-off-by: Takahiro Yamashita --- src/flb_record_accessor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/flb_record_accessor.c b/src/flb_record_accessor.c index 33b02a9e15a..04e46579004 100644 --- a/src/flb_record_accessor.c +++ b/src/flb_record_accessor.c @@ -619,6 +619,9 @@ int flb_ra_regex_match(struct flb_record_accessor *ra, msgpack_object map, struct flb_ra_parser *rp; rp = mk_list_entry_first(&ra->list, struct flb_ra_parser, _head); + if (rp == NULL || rp->key == NULL) { + return -1; + } return flb_ra_key_regex_match(rp->key->name, map, rp->key->subkeys, regex, result); }