Patch php-dotslash.patch for PHAR related Bug #71966
Patch version 2016-04-05 13:10 UTC
Return to Bug #71966 |
Download this patch
Patch Revisions:
Developer: pandrade@redhat.com
diff -up php-5.4.16/ext/phar/tar.c.orig php-5.4.16/ext/phar/tar.c
--- php-5.4.16/ext/phar/tar.c.orig 2016-03-29 11:39:57.020599910 -0300
+++ php-5.4.16/ext/phar/tar.c 2016-03-29 11:42:25.582624697 -0300
@@ -481,6 +481,9 @@ bail:
entry.link = estrdup(hdr->linkname);
}
phar_set_inode(&entry TSRMLS_CC);
+ if (entry.filename_len > 2 && entry.filename[0] == '.' && entry.filename[1] == '/')
+ /* Also copy trailing nul */
+ memmove(entry.filename, entry.filename + 2, (entry.filename_len -= 2) + 1);
zend_hash_add(&myphar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info), (void **) &newentry);
if (entry.is_persistent) {
|