mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Fix null deref in QJS plugin handling
This commit is contained in:
parent
5709416ea5
commit
702cbbef4d
@ -63,8 +63,8 @@ static int on_fcn_rename(RAnal *_anal, void* _user, RAnalFunction *fcn, const ch
|
|||||||
|
|
||||||
static void r_core_debug_breakpoint_hit(RCore *core, RBreakpointItem *bpi) {
|
static void r_core_debug_breakpoint_hit(RCore *core, RBreakpointItem *bpi) {
|
||||||
const char *cmdbp = r_config_get (core->config, "cmd.bp");
|
const char *cmdbp = r_config_get (core->config, "cmd.bp");
|
||||||
const bool cmdbp_exists = (cmdbp && *cmdbp);
|
const bool cmdbp_exists = R_STR_ISNOTEMPTY (cmdbp);
|
||||||
const bool bpcmd_exists = (bpi->data && bpi->data[0]);
|
const bool bpcmd_exists = R_STR_ISNOTEMPTY (bpi->data);
|
||||||
const bool may_output = (cmdbp_exists || bpcmd_exists);
|
const bool may_output = (cmdbp_exists || bpcmd_exists);
|
||||||
if (may_output) {
|
if (may_output) {
|
||||||
r_cons_push ();
|
r_cons_push ();
|
||||||
|
@ -61,6 +61,9 @@
|
|||||||
static int r_cmd_qjs_call(void *c, const char *input) {
|
static int r_cmd_qjs_call(void *c, const char *input) {
|
||||||
RCore *core = c;
|
RCore *core = c;
|
||||||
QjsPluginManager *pm = R_UNWRAP4 (core, lang, session, plugin_data);
|
QjsPluginManager *pm = R_UNWRAP4 (core, lang, session, plugin_data);
|
||||||
|
if (pm == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Iterate over plugins until one returns "true" (meaning the plugin handled the input)
|
// Iterate over plugins until one returns "true" (meaning the plugin handled the input)
|
||||||
QjsCorePlugin *plugin;
|
QjsCorePlugin *plugin;
|
||||||
|
Loading…
Reference in New Issue
Block a user