Fix null deref in strings loading without any file (#2955)

This commit is contained in:
Florian Märkl 2022-05-30 19:34:33 +02:00 committed by Anton Kochkov
parent 49cf6555a8
commit 712709200a

View File

@ -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<char *>(rz_mem_alloc(strlen(res) + 1));
strcpy(copy, res);
return parseJson(copy, str);
return task.getResultJson();
}
CutterJson CutterCore::parseJson(char *res, const char *cmd)