summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-01-11 11:30:52 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-01-11 11:30:52 +0900
commit06b2e6a76c562b7a83669d0ffe7e4ac43a2636db (patch)
treef9645a7a2f10f4ea46ce78e8fa776008f1eab61b /src
parent44edc51612536a9e23dabf7c87afc3996efde027 (diff)
downloadmruby-06b2e6a76c562b7a83669d0ffe7e4ac43a2636db.tar.gz
mruby-06b2e6a76c562b7a83669d0ffe7e4ac43a2636db.zip
Check if ci->target_class is NULL before dereferencing
close #3389 This issue was reported by https://hackerone.com/ston3
Diffstat (limited to 'src')
-rw-r--r--src/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index 3023710d4..7b38659a7 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -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");