Check if ci->target_class is NULL before dereferencing

close #3389
This issue was reported by https://hackerone.com/ston3
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-01-11 11:30:52 +09:00
parent 44edc51612
commit 06b2e6a76c
+1 -1
View File
@@ -1288,7 +1288,7 @@ RETRY_TRY_BLOCK:
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");