diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-10 05:51:12 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-10 05:51:12 +0000 |
commit | 96b19c48a5dee648b51b72e63c3ec0fed90caaff (patch) | |
tree | 7e83e22611426f1307e6f51310f43b053e013db7 /ext | |
parent | 3d8818ace07cfe10a7fb89564bb90ff19def6f27 (diff) | |
download | ruby-96b19c48a5dee648b51b72e63c3ec0fed90caaff.tar.gz |
* 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
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dl/dl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c index 5813adc58b..f11b69c5a5 100644 --- a/ext/dl/dl.c +++ b/ext/dl/dl.c @@ -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 |