From 63c2327b195e44a9a613f899a67d95bab37db4a9 Mon Sep 17 00:00:00 2001 From: Keno Hassler <40292329+kenohassler@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:52:23 +0100 Subject: [PATCH] fixup sarif dump --- .../static_analysis/sast/src/sfa/analysis/tool_runner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sast-fuzz/static_analysis/sast/src/sfa/analysis/tool_runner.py b/sast-fuzz/static_analysis/sast/src/sfa/analysis/tool_runner.py index ae100e1..06bee69 100644 --- a/sast-fuzz/static_analysis/sast/src/sfa/analysis/tool_runner.py +++ b/sast-fuzz/static_analysis/sast/src/sfa/analysis/tool_runner.py @@ -85,8 +85,8 @@ def convert_sarif(string: str) -> SASTFlags: sarif_data = json.loads(string) # dump the SARIF data for debugging, since the main tmp dir is already deleted at this point - sarif_fd, sarif_path = mkstemp(prefix="sarif", suffix=".json", text=True) - with os.fdopen(sarif_fd) as sarif_file: + sarif_fd, sarif_path = mkstemp(prefix="sarif-", suffix=".json", text=True) + with os.fdopen(sarif_fd, "w") as sarif_file: json.dump(sarif_data, sarif_file) logging.debug(f"Raw SARIF data dumped to {sarif_path}.")