]> granicus.if.org Git - php/commitdiff
MFH: return false if realpath()/getcwd() fail
authorAntony Dovgal <tony2001@php.net>
Tue, 16 Jan 2007 14:42:38 +0000 (14:42 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 16 Jan 2007 14:42:38 +0000 (14:42 +0000)
ext/gettext/gettext.c

index f3cc0cbeefd54569d3070bb86b59c9f646734908..7c6d302dc8dae141fab380826ae19b9dd0f124b3 100644 (file)
@@ -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);