summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-05 05:12:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-05 05:12:50 +0000
commit5425f8fe6ead9c2b57547cc64f5b4316fc86bdf1 (patch)
tree780fdc5ca7e4f213bae955c33720c10b8835eeab
parentae824807055802a812a23f19cd1a5086223df11d (diff)
* ruby.c (ruby_init_loadpath_safe): ensure sopath to be modifiable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ruby.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index de31339..c84de63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Aug 5 14:12:44 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (ruby_init_loadpath_safe): ensure sopath to be modifiable
+
Thu Aug 5 12:39:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (str_make_independent_expand): fix buffer overflow
diff --git a/ruby.c b/ruby.c
index 5196b0f..155ef5f 100644
--- a/ruby.c
+++ b/ruby.c
@@ -426,7 +426,7 @@ ruby_init_loadpath_safe(int safe_level)
#define PREFIX_PATH() rb_str_new(libpath, baselen)
#else
baselen = p - libpath;
- rb_str_set_len(sopath, baselen);
+ rb_str_resize(sopath, baselen);
libpath = RSTRING_PTR(sopath);
#define PREFIX_PATH() sopath
#endif