Check if ci->target_class is NULL before dereferencing

close #3389
This issue was reported by https://hackerone.com/ston3
parent 44edc516
...@@ -1288,7 +1288,7 @@ RETRY_TRY_BLOCK: ...@@ -1288,7 +1288,7 @@ RETRY_TRY_BLOCK:
int a = GETARG_A(i); int a = GETARG_A(i);
int n = GETARG_C(i); int n = GETARG_C(i);
if (mid == 0) { if (mid == 0 || !mrb->c->ci->target_class) {
mrb_value exc; mrb_value exc;
exc = mrb_exc_new_str_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method"); exc = mrb_exc_new_str_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment