Skip to content

Commit 9f1b68e

Browse files
committed
fix incompatible pointer
1 parent 7f6d2b1 commit 9f1b68e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/phar/phar_object.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3379,6 +3379,7 @@ PHP_METHOD(Phar, copy)
33793379
const char *pcr_error;
33803380
size_t oldfile_len, newfile_len;
33813381
phar_entry_info *oldentry, newentry = {0}, *temp;
3382+
int tmp_len = 0;
33823383

33833384
PHAR_ARCHIVE_OBJECT();
33843385

@@ -3420,11 +3421,12 @@ PHP_METHOD(Phar, copy)
34203421
}
34213422
}
34223423

3423-
if (phar_path_check(&newfile, &newfile_len, &pcr_error) > pcr_is_ok) {
3424+
if (phar_path_check(&newfile, &tmp_len, &pcr_error) > pcr_is_ok) {
34243425
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
34253426
"file \"%s\" contains invalid characters %s, cannot be copied from \"%s\" in phar %s", newfile, pcr_error, oldfile, phar_obj->archive->fname);
34263427
RETURN_FALSE;
34273428
}
3429+
newfile_len = tmp_len;
34283430

34293431
if (phar_obj->archive->is_persistent) {
34303432
if (FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {

0 commit comments

Comments
 (0)