Permalink
Browse files

Check if ci->target_class is NULL before dereferencing

close #3389
This issue was reported by https://hackerone.com/ston3
  • Loading branch information...
matz committed Jan 11, 2017
1 parent 44edc51 commit 06b2e6a76c562b7a83669d0ffe7e4ac43a2636db
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/vm.c
View
@@ -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");

0 comments on commit 06b2e6a

Please sign in to comment.