summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-28 17:02:53 +0200
committerAnatol Belski <ab@php.net>2014-08-28 17:03:41 +0200
commit9f1b68eda574e18ec0f8e60e9fe28d6319ed36c9 (patch)
treeece504112ea3346482eba4de3e14420ffc58883b
parent7f6d2b124b24b23d37280fb1511de9f5a27d3f1a (diff)
downloadphp-git-9f1b68eda574e18ec0f8e60e9fe28d6319ed36c9.tar.gz
fix incompatible pointer
-rwxr-xr-xext/phar/phar_object.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 0ce1c3f569..2d34cf6bfb 100755
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -3379,6 +3379,7 @@ PHP_METHOD(Phar, copy)
const char *pcr_error;
size_t oldfile_len, newfile_len;
phar_entry_info *oldentry, newentry = {0}, *temp;
+ int tmp_len = 0;
PHAR_ARCHIVE_OBJECT();
@@ -3420,11 +3421,12 @@ PHP_METHOD(Phar, copy)
}
}
- if (phar_path_check(&newfile, &newfile_len, &pcr_error) > pcr_is_ok) {
+ if (phar_path_check(&newfile, &tmp_len, &pcr_error) > pcr_is_ok) {
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
"file \"%s\" contains invalid characters %s, cannot be copied from \"%s\" in phar %s", newfile, pcr_error, oldfile, phar_obj->archive->fname);
RETURN_FALSE;
}
+ newfile_len = tmp_len;
if (phar_obj->archive->is_persistent) {
if (FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {