Fix GH-14603: invalid null zip file entry.

close GH-14610
This commit is contained in:
David Carlier 2024-06-20 05:57:05 +01:00
parent 6704c60589
commit 686afc10bf
No known key found for this signature in database
GPG Key ID: CEF290BB40D2086B
3 changed files with 5 additions and 1 deletions

4
NEWS
View File

@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.2.22
- Phar:
. Fixed bug GH-14603 (null string from zip entry).
(David Carlier)
- PHPDBG:
. Fixed bug GH-14596 (crashes with ASAN and ZEND_RC_DEBUG=1).
(David Carlier)

BIN
ext/phar/tests/gh14603.phpt Normal file

Binary file not shown.

View File

@ -771,7 +771,7 @@ foundit:
}
}
zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), actual_alias, mydata->alias_len, mydata);
zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len, mydata);
mydata->alias = pestrndup(alias, alias_len, mydata->is_persistent);
mydata->alias_len = alias_len;
} else {