[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/17] qapi: Fix crash on stray double quote character
From: |
Markus Armbruster |
Subject: |
[PULL 03/17] qapi: Fix crash on stray double quote character |
Date: |
Tue, 9 May 2023 09:59:57 +0200 |
When the lexer chokes on a stray character, its shows the characters
until the next structural character in the error message. It uses a
regular expression to match a non-empty string of non-structural
characters. Bug: the regular expression treats '"' as structural.
When the lexer chokes on '"', the match fails, and trips
must_match()'s assertion. Fix the regular expression.
Fixes: 14c32795024c (qapi: Improve reporting of lexical errors)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230428105429.1687850-4-armbru@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
---
scripts/qapi/parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 878f90b458..7b49d3ab05 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -346,7 +346,7 @@ def accept(self, skip_comment: bool = True) -> None:
elif not self.tok.isspace():
# Show up to next structural, whitespace or quote
# character
- match = must_match('[^[\\]{}:,\\s\'"]+',
+ match = must_match('[^[\\]{}:,\\s\']+',
self.src[self.cursor-1:])
raise QAPIParseError(self, "stray '%s'" % match.group(0))
--
2.39.2
- [PULL 00/17] QAPI patches patches for 2023-05-09, Markus Armbruster, 2023/05/09
- [PULL 02/17] docs/devel/qapi-code-gen: Turn FIXME admonitions into comments, Markus Armbruster, 2023/05/09
- [PULL 04/17] meson: Fix to make QAPI generator output depend on main.py, Markus Armbruster, 2023/05/09
- [PULL 03/17] qapi: Fix crash on stray double quote character,
Markus Armbruster <=
- [PULL 01/17] docs/devel/qapi-code-gen: Clean up use of quotes a bit, Markus Armbruster, 2023/05/09
- [PULL 10/17] tests/qapi-schema/doc-good: Improve argument description tests, Markus Armbruster, 2023/05/09
- [PULL 09/17] tests/qapi-schema/doc-good: Improve a comment, Markus Armbruster, 2023/05/09
- [PULL 07/17] qapi: Tidy up a slightly awkward TODO comment, Markus Armbruster, 2023/05/09
- [PULL 08/17] qapi/dump: Indent bulleted lists consistently, Markus Armbruster, 2023/05/09
- [PULL 05/17] Revert "qapi: BlockExportRemoveMode: move comments to TODO", Markus Armbruster, 2023/05/09
- [PULL 13/17] qapi: Relax doc string @name: description indentation rules, Markus Armbruster, 2023/05/09
- [PULL 16/17] qga/qapi-schema: Reformat doc comments to conform to current conventions, Markus Armbruster, 2023/05/09
- [PULL 06/17] sphinx/qapidoc: Do not emit TODO sections into user manuals, Markus Armbruster, 2023/05/09
- [PULL 12/17] qapi: Rewrite parsing of doc comment section symbols and tags, Markus Armbruster, 2023/05/09