|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH 25/56] json: Leave rejecting invalid escape sequences to parser |
Date: | Mon, 13 Aug 2018 09:58:46 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 08/13/2018 02:05 AM, Markus Armbruster wrote:
Eric Blake <address@hidden> writes:On 08/08/2018 07:03 AM, Markus Armbruster wrote:Both lexer and parser reject invalid escape sequences in strings. The parser's check is useless.
+ * Extensions over RFC 7159: + * - Extra escape sequence in strings: + * 0x27 (apostrophe) is recognized after escape, too + * - Single-quoted strings: + * Like double-quoted strings, except they're delimited by %x27 + * (apostrophe) instead of %x22 (quotation mark), and can't contain + * unescaped apostrophe, but can contain unescaped quotation mark. + * + * Note: + * - Encoding is modified UTF-8.That is an extension over RFC 7159. But I'm okay with leaving it in the Notes section.+ * - Invalid Unicode characters are rejected. + * - Control characters are rejected by the lexer.Worth being explicit that this is 00-1f, fe, and ff?\xFE and \xFF are invalid, not control. What about: * - Invalid Unicode characters are rejected. * - Control characters \x00..\x1F are rejected by the lexer.
Works for me. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |