summaryrefslogtreecommitdiffstats
path: root/dln.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-19 08:25:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-19 08:25:39 +0000
commit5db2d745164db6c375edd86a5bb28eeb6041d7c0 (patch)
treee91a96aa41166abd1bd8c531fb548999fde63869 /dln.c
parentb693f0f55c7e67f6ef907492fb89d5788af1fe81 (diff)
downloadruby-5db2d745164db6c375edd86a5bb28eeb6041d7c0.tar.gz
ruby-5db2d745164db6c375edd86a5bb28eeb6041d7c0.tar.xz
ruby-5db2d745164db6c375edd86a5bb28eeb6041d7c0.zip
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dln.c b/dln.c
index fbfd6c2db..0993a8416 100644
--- a/dln.c
+++ b/dln.c
@@ -962,8 +962,9 @@ load_lib(lib)
dln_errno = DLN_EBADLIB;
if (lib[0] == '-' && lib[1] == 'l') {
- char *p = alloca(strlen(lib) + 4);
- sprintf(p, "lib%s.a", lib+2);
+ long len = strlen(lib) + 4;
+ char *p = alloca(len);
+ snprintf(p, len, "lib%s.a", lib+2);
lib = p;
}