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

* 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
This commit is contained in:
nobu 2010-08-05 05:12:50 +00:00
parent ae82480705
commit 5425f8fe6e
2 changed files with 5 additions and 1 deletions

View file

@ -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

2
ruby.c
View file

@ -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