Skip to content

Commit

Permalink
unescape: Try to plug fuzzer error
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
  • Loading branch information
cosmo0920 committed Jan 6, 2025
1 parent dfe15aa commit e02c52c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/flb_unescape.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ int flb_unescape_string_utf8(const char *in_buf, int sz, char *out_buf)
size = end - next;
if (size > 0) {
esc_in = u8_read_escape_sequence(next, size, &ch) + 1;
if (esc_in == -1) {
/* skip invalid sequence */
continue;
}
}
else {
/* because char is unsigned char by default on arm, so we need to do a explicit conversion */
Expand Down

0 comments on commit e02c52c

Please sign in to comment.