1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 17570:

* array.c (rb_ary_fill): not depend on unspecified behavior at integer
	  overflow.  reported by Vincenzo Iozzo <snagg AT openssl.it>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2008-06-29 09:23:33 +00:00
parent def72350a9
commit ada89912d7
3 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Sun Jun 29 18:22:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_fill): not depend on unspecified behavior at integer
overflow. reported by Vincenzo Iozzo <snagg AT openssl.it>.
Sun Jun 29 18:22:06 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c(ole_invoke): fix memory leak.

View file

@ -2416,10 +2416,10 @@ rb_ary_fill(argc, argv, ary)
break;
}
rb_ary_modify(ary);
end = beg + len;
if (end < 0) {
if (len > ARY_MAX_SIZE - beg) {
rb_raise(rb_eArgError, "argument too big");
}
end = beg + len;
if (end > RARRAY(ary)->len) {
if (end >= RARRAY(ary)->aux.capa) {
REALLOC_N(RARRAY(ary)->ptr, VALUE, end);

View file

@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-29"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080629
#define RUBY_PATCHLEVEL 30
#define RUBY_PATCHLEVEL 31
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8