Merge pull request #4956 from dearblue/null-local_variables

Fix NULL pointer dereferences in mrb_local_variables; fix #4955
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-03-31 22:04:18 +09:00
committed by GitHub
+1 -1
View File
@@ -139,7 +139,7 @@ mrb_local_variables(mrb_state *mrb, mrb_value self)
proc = mrb->c->ci[-1].proc;
if (MRB_PROC_CFUNC_P(proc)) {
if (proc == NULL || MRB_PROC_CFUNC_P(proc)) {
return mrb_ary_new(mrb);
}
vars = mrb_hash_new(mrb);