Skip to content

Commit

Permalink
Check if ci->target_class is NULL before dereferencing
Browse files Browse the repository at this point in the history
close #3389
This issue was reported by https://hackerone.com/ston3
  • Loading branch information
matz committed Jan 11, 2017
1 parent 44edc51 commit 06b2e6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
int a = GETARG_A(i);
int n = GETARG_C(i);

if (mid == 0) {
if (mid == 0 || !mrb->c->ci->target_class) {
mrb_value exc;

exc = mrb_exc_new_str_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method");
Expand Down

0 comments on commit 06b2e6a

Please sign in to comment.