vm.c: target class may be NULL.

Address CVE-2022-1201
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-04-01 16:40:06 +09:00
parent 2cbfc2f350
commit 82d3b3d11b
+1 -1
View File
@@ -1758,7 +1758,7 @@ RETRY_TRY_BLOCK:
}
else if (target_class->tt == MRB_TT_MODULE) {
target_class = mrb_vm_ci_target_class(ci);
if (target_class->tt != MRB_TT_ICLASS) {
if (!target_class || target_class->tt != MRB_TT_ICLASS) {
goto super_typeerror;
}
}