summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-array-ext/src/array.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-11-16 01:29:04 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-11-16 01:29:04 +0900
commit739dad6e87e91c74cda794ae3f33cd94a7c33eb1 (patch)
tree04efbd14bcc5463fc2a8f7975f2ef9623715f954 /mrbgems/mruby-array-ext/src/array.c
parent4f6cce059b317f7e6c1da801fe0edd487985df6e (diff)
downloadmruby-739dad6e87e91c74cda794ae3f33cd94a7c33eb1.tar.gz
mruby-739dad6e87e91c74cda794ae3f33cd94a7c33eb1.zip
Fixed a memory problem in Array#to_h
Reported from Alex Snaps via Mathieu Leduc-Hamel, both from shopify.com. Thank you!
Diffstat (limited to 'mrbgems/mruby-array-ext/src/array.c')
-rw-r--r--mrbgems/mruby-array-ext/src/array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-array-ext/src/array.c b/mrbgems/mruby-array-ext/src/array.c
index d5c96e2cc..af947303b 100644
--- a/mrbgems/mruby-array-ext/src/array.c
+++ b/mrbgems/mruby-array-ext/src/array.c
@@ -131,7 +131,7 @@ mrb_ary_to_h(mrb_state *mrb, mrb_value ary)
if (mrb_nil_p(v)) {
mrb_raisef(mrb, E_TYPE_ERROR, "wrong element type %S at %S (expected array)",
- mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, RARRAY_PTR(ary)[i])),
+ mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, ary_elt(ary, i))),
mrb_fixnum_value(i)
);
}