From 2e6fd46127e9a5365293d7ab8bfa60225627b402 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)