diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-14 15:39:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-14 15:39:46 +0000 |
commit | 6c9fb8afc188bd8999435be55dd7aecb8d6b374a (patch) | |
tree | 689ae31d573520360c9d957056883e5d611d1f50 | |
parent | 5fda10dd09e285e2a0ee189158f91e3100080950 (diff) | |
download | ruby-6c9fb8afc188bd8999435be55dd7aecb8d6b374a.tar.gz ruby-6c9fb8afc188bd8999435be55dd7aecb8d6b374a.tar.xz ruby-6c9fb8afc188bd8999435be55dd7aecb8d6b374a.zip |
* array.c (ary_resize_capa): should not overwrite outside embedded
array.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | array.c | 3 | ||||
-rw-r--r-- | version.h | 4 |
3 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Sun Feb 15 00:39:44 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * array.c (ary_resize_capa): should not overwrite outside embedded + array. + Sat Feb 14 20:18:19 2009 Tanaka Akira <akr@fsij.org> * test/test_time.rb: extracted from lib/time.rb. @@ -163,7 +163,8 @@ ary_resize_capa(VALUE ary, long capacity) else { if (!ARY_EMBED_P(ary)) { long len = RARRAY_LEN(ary); - VALUE *ptr = RARRAY_PTR(ary); + VALUE *ptr = RARRAY_PTR(ary); + if (len > capacity) len = capacity; MEMCPY(RARRAY(ary)->as.ary, ptr, VALUE, len); FL_SET_EMBED(ary); ARY_SET_LEN(ary, len); @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_RELEASE_DATE "2009-02-14" +#define RUBY_RELEASE_DATE "2009-02-15" #define RUBY_PATCHLEVEL -1 #define RUBY_BRANCH_NAME "trunk" @@ -8,7 +8,7 @@ #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 14 +#define RUBY_RELEASE_DAY 15 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; |