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

* ext/dl/dl.c (rb_dl_strdup): strdup() only allocates a buffer of

strlen()+1 bytes. [Bug #2794]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2010-06-10 05:51:12 +00:00
parent 3d8818ace0
commit 96b19c48a5
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Jun 10 14:45:28 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* ext/dl/dl.c (rb_dl_strdup): strdup() only allocates a buffer of
strlen()+1 bytes. [Bug #2794]
Tue Jun 8 18:32:47 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
* configure.in (USE_WINSOCK2): ws2tcpip.h needs listed here.

View file

@ -588,7 +588,7 @@ VALUE
rb_dl_strdup(VALUE self, VALUE str)
{
SafeStringValue(str);
return rb_dlptr_new(strdup(RSTRING(str)->ptr), RSTRING(str)->len, dlfree);
return rb_dlptr_new(strdup(RSTRING(str)->ptr), strlen(RSTRING(str)->ptr)+1, dlfree);
}
static VALUE