From 298da20fe62d0c37f7ee6ec7f9a87bdfb4e5f19b Mon Sep 17 00:00:00 2001 From: David Korczynski Date: Sat, 7 Jan 2023 06:58:27 -0800 Subject: [PATCH] signv4: handle error case `flb_kv_item_create_len` may fail and this should be handled. Signed-off-by: David Korczynski --- src/flb_signv4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/flb_signv4.c b/src/flb_signv4.c index 768f2360260..4e405968231 100644 --- a/src/flb_signv4.c +++ b/src/flb_signv4.c @@ -497,6 +497,9 @@ void headers_sanitize(struct mk_list *in_list, struct mk_list *out_list) kv = flb_kv_item_create_len(&out_tmp, kv->key, flb_sds_len(kv->key), v_start, v_end - v_start); + if (kv == NULL) { + continue; + } for (x = 0; x < flb_sds_len(kv->key); x++) { kv->key[x] = tolower(kv->key[x]); }