]> granicus.if.org Git - php/commitdiff
MFB
authorNuno Lopes <nlopess@php.net>
Sat, 16 Sep 2006 17:42:44 +0000 (17:42 +0000)
committerNuno Lopes <nlopess@php.net>
Sat, 16 Sep 2006 17:42:44 +0000 (17:42 +0000)
ext/posix/posix.c
ext/posix/tests/001.phpt [new file with mode: 0644]

index 9f85fa60addd7b1a602d5341b58213954d15034a..1955c1d07278611168d6c29f42b98e98a9df6aeb 100644 (file)
@@ -766,6 +766,10 @@ PHP_FUNCTION(posix_access)
        }
 
        path = expand_filepath(filename, NULL TSRMLS_CC);
+       if (!path) {
+               POSIX_G(last_error) = EIO;
+               RETURN_FALSE;
+       }
 
        if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
                efree(path);
diff --git a/ext/posix/tests/001.phpt b/ext/posix/tests/001.phpt
new file mode 100644 (file)
index 0000000..e6c629c
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+posix_access() with bogus paths
+--SKIPIF--
+<?php if (!extension_loaded('posix')) echo 'skip'; ?>
+--FILE--
+<?php
+
+var_dump(posix_access(str_repeat('bogus path', 1042)));
+
+?>
+--EXPECT--
+bool(false)