1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

phar: Drop buggy redundant Windows-only check (#20195)

If the path contains '\' the path is duplicated and unixified.
In practice this is always true. And if it were not, we'd get a heap
corruption as the cleanup code assumes it is.
This commit is contained in:
Niels Dossche
2025-10-17 08:09:42 +02:00
committed by GitHub
parent 0ed7424a33
commit ade8e2d8cd

View File

@@ -609,10 +609,8 @@ PHP_METHOD(Phar, webPhar)
fname_len = ZSTR_LEN(zend_file_name);
#ifdef PHP_WIN32
if (memchr(fname, '\\', fname_len)) {
fname = estrndup(fname, fname_len);
phar_unixify_path_separators(fname, fname_len);
}
fname = estrndup(fname, fname_len);
phar_unixify_path_separators(fname, fname_len);
#endif
basename = zend_memrchr(fname, '/', fname_len);