summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 393b5c28ff..83af1280d3 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -927,6 +927,10 @@ static ZIPARCHIVE_METHOD(open)
RETURN_FALSE;
}
+ if (OPENBASEDIR_CHECKPATH(filename)) {
+ RETURN_FALSE;
+ }
+
if(!expand_filepath(filename, resolved_path TSRMLS_CC)) {
RETURN_FALSE;
}
@@ -1067,6 +1071,10 @@ static ZIPARCHIVE_METHOD(addFile)
}
}
+ if (OPENBASEDIR_CHECKPATH(filename)) {
+ RETURN_FALSE;
+ }
+
if(!expand_filepath(filename, resolved_path TSRMLS_CC)) {
if (Z_TYPE_PP(filename_zval) == IS_UNICODE) {
efree(entry_name);