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 GitHub
parent a630a8f5bc
commit 2e6fd46127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)