From 5b7e24d744340345c11578911e3f1fa4ab0fb9cc Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 19 Jul 2005 08:25:39 +0000 Subject: * io.c (rb_io_inspect): replace sprintf() with "%s" format all over the place by snprintf() to avoid integer overflow. * sample/svr.rb: service can be stopped by ill-behaved client; use tsvr.rb instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index c94109e112..746add0025 100644 --- a/io.c +++ b/io.c @@ -952,7 +952,7 @@ rb_io_inspect(obj) len += 9; } buf = ALLOCA_N(char, len); - sprintf(buf, "#<%s:%s%s>", cname, fptr->path, st); + snprintf(buf, len, "#<%s:%s%s>", cname, fptr->path, st); return rb_str_new2(buf); } -- cgit v1.2.3