From aba3d427c78e20965d99e6843bf4bf67b98cd8c1 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 14 Feb 2022 16:04:44 +0900 Subject: [PATCH] state.c: `reps` may be NULL if a broken compiled binary given. --- src/state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/state.c b/src/state.c index 4dafc964a..4045a0fed 100644 --- a/src/state.c +++ b/src/state.c @@ -137,6 +137,7 @@ mrb_irep_cutref(mrb_state *mrb, mrb_irep *irep) if (irep->flags & MRB_IREP_NO_FREE) return; reps = (mrb_irep**)irep->reps; + if (!reps) return; for (i=0; irlen; i++) { mrb_irep *tmp = reps[i]; reps[i] = NULL;