Skip to content

Commit

Permalink
unescape: utf8: do not read escaped newline (#615) (#692)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
meggarr authored and edsiper committed Aug 16, 2018
1 parent 1fbc73e commit a988dac
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/flb_unescape.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ static int u8_read_escape_sequence(char *str, uint32_t *dest)
static inline int is_json_escape(char *c)
{
return (
(*c == '\"') || // double-quote
(*c == '\'') || // single-quote
(*c == '\\') || // solidus
(*c == '/') // reverse-solidus
);
(*c == '\"') || /* double-quote */
(*c == '\'') || /* single-quote */
(*c == '\\') || /* solidus */
(*c == 'n') || /* new-line */
(*c == '/') /* reverse-solidus */
);
}

int flb_unescape_string_utf8(char *in_buf, int sz, char *out_buf)
Expand Down

0 comments on commit a988dac

Please sign in to comment.