]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi.py: Reject invalid characters in schema file
authorMarkus Armbruster <armbru@redhat.com>
Sat, 27 Jul 2013 15:41:57 +0000 (17:41 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 29 Jul 2013 15:37:11 +0000 (10:37 -0500)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1374939721-7876-6-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scripts/qapi.py
tests/qapi-schema/comments.err
tests/qapi-schema/comments.exit
tests/qapi-schema/comments.out
tests/qapi-schema/funny-char.err
tests/qapi-schema/funny-char.exit
tests/qapi-schema/funny-char.out

index 342d16c4e8870618d94a636d63b5de49bdea6f74..0b48a1e50a7b14c066faa3fa804cfdce1827dd26 100644 (file)
@@ -101,6 +101,8 @@ class QAPISchema:
                 if self.cursor == len(self.src):
                     self.tok = None
                     return
+            elif not self.tok.isspace():
+                raise QAPISchemaError(self, 'Stray "%s"' % self.tok)
 
     def get_members(self):
         expr = OrderedDict()
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4a82b26d0f8bb054e8e97c7ec3d5b7e725833435 100644 (file)
@@ -0,0 +1 @@
+<stdin>:2:33: Stray "#"
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index e3bd904453988a5926204cc6eaf3faa57213435a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])]
-['Status']
-[]
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d3dd293faf23df88669384b13a76181c6dd8d4ef 100644 (file)
@@ -0,0 +1 @@
+<stdin>:2:36: Stray ";"
index 573541ac9702dd3969c9bc859d2b91ec1f7e6e56..d00491fd7e5bb6fa28c517a0bb32b8b506539d4d 100644 (file)
@@ -1 +1 @@
-0
+1
index e3bd904453988a5926204cc6eaf3faa57213435a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])]
-['Status']
-[]