summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-12 06:19:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-12 06:19:06 +0000
commit9391daf9543835f2a5dd850cee422310d8e79449 (patch)
tree127cdc91b84ebb3523ae0c368653c05acc8fe83d /io.c
parent35028627e581b0a77385e6d6f4fee799c4a6a2f2 (diff)
downloadruby-9391daf9543835f2a5dd850cee422310d8e79449.tar.gz
* io.c (rb_io_s_sysopen): should not use alloca for unknowen size
input. [ruby-dev:31775] * parse.y (rb_id2str): ditto. * marshal.c (w_float): use snprintf instead of sprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index b299689a38..fa63537ab5 100644
--- a/io.c
+++ b/io.c
@@ -3455,8 +3455,8 @@ rb_io_s_sysopen(int argc, VALUE *argv)
if (NIL_P(perm)) fmode = 0666;
else fmode = NUM2INT(perm);
- path = ALLOCA_N(char, strlen(RSTRING_PTR(fname))+1);
- strcpy(path, RSTRING_PTR(fname));
+ RB_GC_GUARD(fname) = rb_str_new4(fname);
+ path = RSTRING_PTR(fname);
fd = rb_sysopen(path, flags, fmode);
return INT2NUM(fd);
}