mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 20:36:09 +00:00
Fix null deref in strings loading without any file (#2955)
This commit is contained in:
parent
49cf6555a8
commit
712709200a
@ -542,10 +542,7 @@ CutterJson CutterCore::cmdjTask(const QString &str)
|
|||||||
RizinCmdTask task(str);
|
RizinCmdTask task(str);
|
||||||
task.startTask();
|
task.startTask();
|
||||||
task.joinTask();
|
task.joinTask();
|
||||||
const char *res = task.getResultRaw();
|
return task.getResultJson();
|
||||||
char *copy = static_cast<char *>(rz_mem_alloc(strlen(res) + 1));
|
|
||||||
strcpy(copy, res);
|
|
||||||
return parseJson(copy, str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CutterJson CutterCore::parseJson(char *res, const char *cmd)
|
CutterJson CutterCore::parseJson(char *res, const char *cmd)
|
||||||
|
Loading…
Reference in New Issue
Block a user