Re: [Qemu-devel] [PATCH 23/56] json: Leave rejecting invalid UTF-8 to parser

2018-08-10 Thread Eric Blake
On 08/08/2018 07:03 AM, Markus Armbruster wrote: Both the lexer and the parser (attempt to) validate UTF-8 in JSON strings. The commit before previous made the parser reject invalid UTF-8 sequences. Since then, anything the lexer rejects, the parser would reject as well. Thus, the lexer's

[Qemu-devel] [PATCH 23/56] json: Leave rejecting invalid UTF-8 to parser

2018-08-08 Thread Markus Armbruster
Both the lexer and the parser (attempt to) validate UTF-8 in JSON strings. The lexer rejects bytes that can't occur in valid UTF-8: \xC0..\xC1, \xF5..\xFF. This rejects some, but not all invalid UTF-8. It also rejects ASCII control characters \x00..\x1F, in accordance with RFC 7159 (see recent c