From 38acb9ec36bdd56123e6680885499fbf7f729f21 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 12 Jan 2017 21:43:23 +0900 Subject: Kernel#initialize should not break existing mt; fix #3397 This issue was reported by https://hackerone.com/icanthack The solution is suggested by @clayton-shopify. --- src/class.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/class.c') diff --git a/src/class.c b/src/class.c index cb7bdfddd..45827f5ba 100644 --- a/src/class.c +++ b/src/class.c @@ -915,7 +915,9 @@ boot_defclass(mrb_state *mrb, struct RClass *super) static void boot_initmod(mrb_state *mrb, struct RClass *mod) { - mod->mt = kh_init(mt, mrb); + if (!mod->mt) { + mod->mt = kh_init(mt, mrb); + } } static struct RClass* -- cgit v1.2.3