Skip to content

Commit ade8e2d

Browse files
authored
phar: Drop buggy redundant Windows-only check (php#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.
1 parent 0ed7424 commit ade8e2d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/phar/phar_object.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,8 @@ PHP_METHOD(Phar, webPhar)
609609
fname_len = ZSTR_LEN(zend_file_name);
610610

611611
#ifdef PHP_WIN32
612-
if (memchr(fname, '\\', fname_len)) {
613-
fname = estrndup(fname, fname_len);
614-
phar_unixify_path_separators(fname, fname_len);
615-
}
612+
fname = estrndup(fname, fname_len);
613+
phar_unixify_path_separators(fname, fname_len);
616614
#endif
617615
basename = zend_memrchr(fname, '/', fname_len);
618616

0 commit comments

Comments
 (0)