From faac53f7baec4a2919bb941c0b7c0fcb62985381 Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 19 Mar 2002 15:45:53 +0000 Subject: * util.c (ruby_getcwd): the content of buf is uncertain and must not be printed when getcwd(buf, size) has failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ util.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ff24f8fab8..bfeda548fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 20 00:36:43 2002 Akinori MUSHA + + * util.c (ruby_getcwd): the content of buf is uncertain and must + not be printed when getcwd(buf, size) has failed. + Mon Mar 18 22:19:52 2002 Nobuyoshi Nakada * ext/stringio/stringio.c (check_modifiable): wrong declaration. diff --git a/util.c b/util.c index 26a35ed398..512b00b47a 100644 --- a/util.c +++ b/util.c @@ -642,7 +642,7 @@ ruby_getcwd() char *buf = xmalloc(size); while (!getcwd(buf, size)) { - if (errno != ERANGE) rb_sys_fail(buf); + if (errno != ERANGE) rb_sys_fail(NULL); size *= 2; buf = xrealloc(buf, size); } -- cgit v1.2.3