From: Antony Dovgal Date: Tue, 16 Jan 2007 14:42:14 +0000 (+0000) Subject: return false if realpath()/getcwd() fail X-Git-Tag: RELEASE_1_0_0RC1~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7511c4ac189f9ab4e9466e3f584a8b1e1f593c36;p=php return false if realpath()/getcwd() fail --- diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index ffa6e7795a..88daefa739 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -236,9 +236,11 @@ PHP_NAMED_FUNCTION(zif_bindtextdomain) php_error_docref(NULL TSRMLS_CC, E_WARNING, "the first parameter must not be empty"); } if (!dir_len || (dir_len == 1 && *dir_str == '0')) { - VCWD_GETCWD(dir_tmp, sizeof(dir_tmp)); - } else { - VCWD_REALPATH(dir_str, dir_tmp); + if (!VCWD_GETCWD(dir_tmp, sizeof(dir_tmp))) { + RETURN_FALSE; + } + } else if (!VCWD_REALPATH(dir_str, dir_tmp)) { + RETURN_FALSE; } RETURN_FS_STRING(bindtextdomain(domain_str, dir_tmp), ZSTR_DUPLICATE); }