Skip to content

Commit

Permalink
signv4: handle error case
Browse files Browse the repository at this point in the history
`flb_kv_item_create_len` may fail and this should be handled.

Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored and PettitWesley committed Jan 17, 2023
1 parent 27f490c commit 298da20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/flb_signv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down

0 comments on commit 298da20

Please sign in to comment.