summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorBoris Lytochkin <lytboris@php.net>2013-05-03 11:21:48 +0400
committerBoris Lytochkin <lytboris@php.net>2013-05-03 11:21:48 +0400
commitaa448adc8347c072421103d1a92b0a7a75ec873f (patch)
treea8f3dbfd72e00f4191f2836a4543fd86813d982e /ext/zip/php_zip.c
parent62364e6e01092911fa11e6d28f9acc3ed9af07e8 (diff)
parent4a34d4a83cd87a0b3fe499936f93e632cc594685 (diff)
downloadphp-git-aa448adc8347c072421103d1a92b0a7a75ec873f.tar.gz
Merge branch 'PHP-5.3' of https://git.php.net/push/php-src into PHP-5.3
* 'PHP-5.3' of https://git.php.net/push/php-src: (39 commits) NEWS From code coverity scan, syscall return value must be check. fix more resource leaks From code coverity scan - fix some memory leak - fix some resources leak (fd) - create fpm_worker_pool_free (shared use) - possible null dref (wp->user and wp->home can be null) fixed size array cannot be null use limit_extensions as we use security_limit_extensions later (free) unused variable fix possible null deref (detected by code coverity scan) Also fixed bug #64726 in 5.3 Fix memory realted to #64726 Fix Test Bug #64714 PHP 5.3.26 this will be Fix NEWS Fix bug #64458 (dns_get_record result with string of length -1) Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function. Fixed stream_socket_pair() on Windows x64 and - Updated to version 2013.3 (2013c) lower the limit, should fit in a byte updated lib versions allow lcov 1.10 ...
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index bdd35a2ede..b1a1a3628c 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -28,6 +28,7 @@
#include "ext/standard/file.h"
#include "ext/standard/php_string.h"
#include "ext/pcre/php_pcre.h"
+#include "ext/standard/php_filestat.h"
#include "php_zip.h"
#include "lib/zip.h"
#include "lib/zipint.h"
@@ -309,6 +310,7 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam
struct zip_source *zs;
int cur_idx;
char resolved_path[MAXPATHLEN];
+ zval exists_flag;
if (ZIP_OPENBASEDIR_CHECKPATH(filename)) {
@@ -319,6 +321,11 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam
return -1;
}
+ php_stat(resolved_path, strlen(resolved_path), FS_EXISTS, &exists_flag TSRMLS_CC);
+ if (!Z_BVAL(exists_flag)) {
+ return -1;
+ }
+
zs = zip_source_file(za, resolved_path, offset_start, offset_len);
if (!zs) {
return -1;