From 712709200aa9e11ac09e7d83a82e3a1ee0d1598f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Mon, 30 May 2022 19:34:33 +0200 Subject: [PATCH] Fix null deref in strings loading without any file (#2955) --- src/core/Cutter.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index ee27caaa..0f31eddd 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -542,10 +542,7 @@ CutterJson CutterCore::cmdjTask(const QString &str) RizinCmdTask task(str); task.startTask(); task.joinTask(); - const char *res = task.getResultRaw(); - char *copy = static_cast(rz_mem_alloc(strlen(res) + 1)); - strcpy(copy, res); - return parseJson(copy, str); + return task.getResultJson(); } CutterJson CutterCore::parseJson(char *res, const char *cmd)