summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/posix.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index aeaae224b2..b4ba1aff0b 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -842,6 +842,10 @@ PHP_FUNCTION(posix_mkfifo)
RETURN_FALSE;
}
+ if (strlen(path) != path_len) {
+ RETURN_FALSE;
+ }
+
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
(PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) {
RETURN_FALSE;
@@ -877,6 +881,10 @@ PHP_FUNCTION(posix_mknod)
RETURN_FALSE;
}
+ if (strlen(path) != path_len) {
+ RETURN_FALSE;
+ }
+
if (php_check_open_basedir_ex(path, 0 TSRMLS_CC) ||
(PG(safe_mode) && (!php_checkuid(path, NULL, CHECKUID_ALLOW_ONLY_DIR)))) {
RETURN_FALSE;
@@ -957,6 +965,10 @@ PHP_FUNCTION(posix_access)
RETURN_FALSE;
}
+ if (strlen(filename) != filename_len) {
+ RETURN_FALSE;
+ }
+
path = expand_filepath(filename, NULL TSRMLS_CC);
if (!path) {
POSIX_G(last_error) = EIO;