From 7511c4ac189f9ab4e9466e3f584a8b1e1f593c36 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 16 Jan 2007 14:42:14 +0000 Subject: [PATCH] return false if realpath()/getcwd() fail --- ext/gettext/gettext.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); } -- 2.50.1