diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-01-12 21:43:23 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-01-12 21:43:23 +0900 |
| commit | 38acb9ec36bdd56123e6680885499fbf7f729f21 (patch) | |
| tree | d6c27186d83a331d07ad3fd0106bc41b27434d4f /src/class.c | |
| parent | 41eff635bf1e592ed71cca4e98136e09b637fbc1 (diff) | |
| download | mruby-38acb9ec36bdd56123e6680885499fbf7f729f21.tar.gz mruby-38acb9ec36bdd56123e6680885499fbf7f729f21.zip | |
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.
Diffstat (limited to 'src/class.c')
| -rw-r--r-- | src/class.c | 4 |
1 files changed, 3 insertions, 1 deletions
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* |
