mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
qapi: Restrict strings to printable ASCII
RFC 8259 on string contents: All Unicode characters may be placed within the quotation marks, except for the characters that MUST be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F). The QAPI schema parser accepts both less and more than JSON: it accepts only ASCII with \u (less), and accepts control characters other than LF (new line) unescaped. How it treats unescaped non-ASCII input differs between Python 2 and Python 3. Make it accept strictly less: require printable ASCII. Drop support for \b, \f, \n, \r, \t. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190913201349.24332-7-armbru@redhat.com>
This commit is contained in:
parent
05d6ecd049
commit
56a8caff92
12 changed files with 20 additions and 21 deletions
2
tests/qapi-schema/string-code-point-127.json
Normal file
2
tests/qapi-schema/string-code-point-127.json
Normal file
|
@ -0,0 +1,2 @@
|
|||
# We accept printable ASCII: code points 32..126. Test code point 127:
|
||||
{ 'command': '' }
|
Loading…
Add table
Add a link
Reference in a new issue