From 4a13ef4b17c8a6be4cdfbcef36ebb5cf137a222d Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 14 Mar 2007 12:02:40 +0000 Subject: [PATCH] - add openbase_dir checks in ::open and addFile() --- ext/zip/php_zip.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.40.0