diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-06-06 12:39:43 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2024-06-10 13:05:27 -0400 |
commit | 4c2b6f328742084a5bd770af7c3a2ef07828c41c (patch) | |
tree | 5d7631b761c3d5fb5718d6d5ee8e4ccdff32a745 /scripts | |
parent | 956f63f87826fcd96d256bdbca17d31b060940e0 (diff) |
tracetool: Forbid newline character in event format
Events aren't designed to be multi-lines. Multiple events
can be used instead. Prevent that format using multi-lines
by forbidding the newline character.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Mads Ynddal <mads@ynddal.dk>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20240606103943.79116-6-philmd@linaro.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/tracetool/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 7237abe0e8..bc03238c0f 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -301,6 +301,8 @@ class Event(object): if fmt.endswith(r'\n"'): raise ValueError("Event format must not end with a newline " "character") + if '\\n' in fmt: + raise ValueError("Event format must not use new line character") if len(fmt_trans) > 0: fmt = [fmt_trans, fmt] |