summaryrefslogtreecommitdiff
path: root/ext/gettext
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-01-16 14:42:38 +0000
committerAntony Dovgal <tony2001@php.net>2007-01-16 14:42:38 +0000
commitbb691f155c441be598de25f3880f0b48fb9a6ff9 (patch)
treee2e7808b5b812aa8252e5b87dec774bf57340489 /ext/gettext
parent5b4043554a4575f4923a453a484911dfe9e080d0 (diff)
downloadphp-git-bb691f155c441be598de25f3880f0b48fb9a6ff9.tar.gz
MFH: return false if realpath()/getcwd() fail
Diffstat (limited to 'ext/gettext')
-rw-r--r--ext/gettext/gettext.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index f3cc0cbeef..7c6d302dc8 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -253,9 +253,11 @@ PHP_NAMED_FUNCTION(zif_bindtextdomain)
}
if (Z_STRVAL_PP(dir)[0] != '\0' && strcmp(Z_STRVAL_PP(dir), "0")) {
- VCWD_REALPATH(Z_STRVAL_PP(dir), dir_name);
- } else {
- VCWD_GETCWD(dir_name, MAXPATHLEN);
+ if (!VCWD_REALPATH(Z_STRVAL_PP(dir), dir_name)) {
+ RETURN_FALSE;
+ }
+ } else if (!VCWD_GETCWD(dir_name, MAXPATHLEN)) {
+ RETURN_FALSE;
}
retval = bindtextdomain(Z_STRVAL_PP(domain_name), dir_name);