Permalink
Browse files

Hash#dup didn't check if internal khash is initialized; fix #3609

  • Loading branch information...
matz committed Apr 18, 2017
1 parent 7614939 commit c3961847cfb9b5370814bd433b0f5c42c034801f
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/hash.c
View
@@ -238,7 +238,7 @@ mrb_hash_dup(mrb_state *mrb, mrb_value hash)
ret = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class);
ret->ht = kh_init(ht, mrb);
if (kh_size(h) > 0) {
if (h && kh_size(h) > 0) {
ret_h = ret->ht;
for (k = kh_begin(h); k != kh_end(h); k++) {

0 comments on commit c396184

Please sign in to comment.