Skip to content
Permalink
Browse files
Add mrb_hash_modify() to Hash#{delete,clear}; ref #3370
This issue was reported by https://hackerone.com/an0n-j
  • Loading branch information
matz committed Jan 5, 2017
1 parent bc1259d commit 2e0c2b58076ce24508a584091f8af9bf8c22f64d
Showing 1 changed file with 2 additions and 0 deletions.
@@ -554,6 +554,7 @@ mrb_hash_delete(mrb_state *mrb, mrb_value self)
mrb_value key;

mrb_get_args(mrb, "o", &key);
mrb_hash_modify(mrb, self);
return mrb_hash_delete_key(mrb, self, key);
}

@@ -620,6 +621,7 @@ mrb_hash_clear(mrb_state *mrb, mrb_value hash)
{
khash_t(ht) *h = RHASH_TBL(hash);

mrb_hash_modify(mrb, hash);
if (h) kh_clear(ht, mrb, h);
return hash;
}

0 comments on commit 2e0c2b5

Please sign in to comment.