Skip to content

Commit

Permalink
Kernel#initialize should not break existing mt; fix #3397
Browse files Browse the repository at this point in the history
This issue was reported by https://hackerone.com/icanthack
The solution is suggested by @clayton-shopify.
  • Loading branch information
matz committed Jan 12, 2017
1 parent 41eff63 commit 38acb9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down

0 comments on commit 38acb9e

Please sign in to comment.