. Fixed bug #67403 (Add signatureType to openssl_x509_parse).
. Add a check for RAND_egd to allow compiling against LibreSSL (Leigh)
+- Phar:
+ . Fixed bug 64343 (PharData::extractTo fails for tarball created by BSD tar).
+ (Mike)
+
- Postgres:
. Fixed bug #68741 (Null pointer dereference) (CVE-2015-1352). (Laruence)
#define TAR_SYMLINK '2'
#define TAR_DIR '5'
#define TAR_NEW '8'
+#define TAR_GLOBAL_HDR 'g'
+#define TAR_FILE_HDR 'x'
#define PHAR_MUNG_PHP_SELF (1<<0)
#define PHAR_MUNG_REQUEST_URI (1<<1)
size = entry.uncompressed_filesize = entry.compressed_filesize =
phar_tar_number(hdr->size, sizeof(hdr->size));
+ /* skip global/file headers (pax) */
+ if (!old && (hdr->typeflag == TAR_GLOBAL_HDR || hdr->typeflag == TAR_FILE_HDR)) {
+ size = (size+511)&~511;
+ goto next;
+ }
+
if (((!old && hdr->prefix[0] == 0) || old) && strlen(hdr->name) == sizeof(".phar/signature.bin")-1 && !strncmp(hdr->name, ".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
off_t curloc;
size = (size+511)&~511;
if (((hdr->typeflag == '\0') || (hdr->typeflag == TAR_FILE)) && size > 0) {
+next:
/* this is not good enough - seek succeeds even on truncated tars */
php_stream_seek(fp, size, SEEK_CUR);
if ((uint)php_stream_tell(fp) > totalsize) {
--- /dev/null
+--TEST--
+Bug #64343 (phar cannot open tars with pax headers)
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE--
+<?php
+
+echo "Test\n";
+
+$phar = new PharData(__DIR__."/files/bug64343.tar");
+
+?>
+===DONE===
+--EXPECT--
+Test
+===DONE===