From 98e63de0d75d18565c629ce9b045edb334e6b477 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Sun, 15 Jun 2008 13:52:58 +0000 Subject: merge revision(s) 16400: * string.c (rb_str_cat): fixed buffer overrun reported by Christopher Thompson in [ruby-core:16746] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 2 +- version.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b46690ffac..116d413318 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jun 15 22:52:24 2008 Yukihiro Matsumoto + + * string.c (rb_str_cat): fixed buffer overrun reported by + Christopher Thompson in [ruby-core:16746] + Sun Jun 15 22:50:34 2008 Yukihiro Matsumoto * eval.c (is_defined): add NODE_OP_ASGN_{OR,AND}. "defined?(a||=1)" diff --git a/string.c b/string.c index f5de52c152..5b1aefaac8 100644 --- a/string.c +++ b/string.c @@ -744,7 +744,7 @@ rb_str_cat(str, ptr, len) } if (FL_TEST(str, STR_ASSOC)) { rb_str_modify(str); - REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len+len); + REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len+len+1); memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len); RSTRING(str)->len += len; RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; /* sentinel */ diff --git a/version.h b/version.h index 9cf7f01b61..4af88b0dfa 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-06-15" #define RUBY_VERSION_CODE 185 #define RUBY_RELEASE_CODE 20080615 -#define RUBY_PATCHLEVEL 207 +#define RUBY_PATCHLEVEL 208 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit v1.2.3