[PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar phar_internal.h zip.c /ext/phar/tests/zip bzip2.phpt /ext/phar/tests/zip/files bz2_alias.phar.zip

2008-09-14 Thread Greg Beaver
cellog  Sun Sep 14 06:31:20 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests/zip/files   bz2_alias.phar.zip 

  Modified files:  
/php-src/ext/phar   phar_internal.h zip.c 
/php-src/ext/phar/tests/zip bzip2.phpt 
  Log:
  increase code coverage, fix bzip2-compressed alias in zip
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_internal.h?r1=1.109.2.25r2=1.109.2.26diff_format=u
Index: php-src/ext/phar/phar_internal.h
diff -u php-src/ext/phar/phar_internal.h:1.109.2.25 
php-src/ext/phar/phar_internal.h:1.109.2.26
--- php-src/ext/phar/phar_internal.h:1.109.2.25 Sat Sep 13 22:30:55 2008
+++ php-src/ext/phar/phar_internal.hSun Sep 14 06:31:19 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_internal.h,v 1.109.2.25 2008/09/13 22:30:55 cellog Exp $ */
+/* $Id: phar_internal.h,v 1.109.2.26 2008/09/14 06:31:19 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -555,7 +555,7 @@
 static inline int phar_validate_alias(const char *alias, int alias_len) /* {{{ 
*/
 {
return !(memchr(alias, '/', alias_len) || memchr(alias, '\\', 
alias_len) || memchr(alias, ':', alias_len) ||
-   memchr(alias, ';', alias_len));
+   memchr(alias, ';', alias_len) || memchr(alias, '\n', alias_len) 
|| memchr(alias, '\r', alias_len));
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/zip.c?r1=1.47.2.18r2=1.47.2.19diff_format=u
Index: php-src/ext/phar/zip.c
diff -u php-src/ext/phar/zip.c:1.47.2.18 php-src/ext/phar/zip.c:1.47.2.19
--- php-src/ext/phar/zip.c:1.47.2.18Sun Aug 31 02:14:03 2008
+++ php-src/ext/phar/zip.c  Sun Sep 14 06:31:20 2008
@@ -465,10 +465,27 @@
if (!actual_alias  entry.filename_len == 
sizeof(.phar/alias.txt)-1  !strncmp(entry.filename, .phar/alias.txt, 
sizeof(.phar/alias.txt)-1)) {
php_stream_filter *filter;
off_t saveloc;
+   /* verify local file header */
+   phar_zip_file_header local;
 
-   /* archive alias found, seek to file contents, do not 
validate local header. Potentially risky, but not very. */
+   /* archive alias found */
saveloc = php_stream_tell(fp);
-   php_stream_seek(fp, PHAR_GET_32(zipentry.offset) + 
sizeof(phar_zip_file_header) + entry.filename_len + 
PHAR_GET_16(zipentry.extra_len), SEEK_SET);
+   php_stream_seek(fp, PHAR_GET_32(zipentry.offset), 
SEEK_SET);
+
+   if (sizeof(local) != php_stream_read(fp, (char *) 
local, sizeof(local))) {
+   PHAR_ZIP_FAIL(phar error: internal corruption 
of zip-based phar (cannot read local file header for alias));
+   }
+
+   /* verify local header */
+   if (entry.filename_len != 
PHAR_GET_16(local.filename_len) || entry.crc32 != PHAR_GET_32(local.crc32) || 
entry.uncompressed_filesize != PHAR_GET_32(local.uncompsize) || 
entry.compressed_filesize != PHAR_GET_32(local.compsize)) {
+   PHAR_ZIP_FAIL(phar error: internal corruption 
of zip-based phar (local head of alias does not match central directory));
+   }
+
+   /* construct actual offset to file start - local 
extra_len can be different from central extra_len */
+   entry.offset = entry.offset_abs =
+   sizeof(local) + entry.header_offset + 
PHAR_GET_16(local.filename_len) + PHAR_GET_16(local.extra_len);
+   php_stream_seek(fp, entry.offset, SEEK_SET);
+
mydata-alias_len = entry.uncompressed_filesize;
 
if (entry.flags  PHAR_ENT_COMPRESSED_GZ) {
@@ -498,7 +515,6 @@
}
 
php_stream_filter_append(fp-readfilters, 
filter);
-   php_stream_filter_append(fp-readfilters, 
filter);
 
if (!(entry.uncompressed_filesize = 
php_stream_copy_to_mem(fp, actual_alias, entry.uncompressed_filesize, 0)) || 
!actual_alias) {
pefree(entry.filename, 
entry.is_persistent);
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/zip/bzip2.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/phar/tests/zip/bzip2.phpt
diff -u php-src/ext/phar/tests/zip/bzip2.phpt:1.1.2.1 
php-src/ext/phar/tests/zip/bzip2.phpt:1.1.2.2
--- php-src/ext/phar/tests/zip/bzip2.phpt:1.1.2.1   Thu Aug 21 05:17:28 2008
+++ php-src/ext/phar/tests/zip/bzip2.phpt   Sun Sep 14 06:31:20 2008
@@ -11,6 +11,8 @@
foreach ($a as $entry = $file) {
echo $file-getContent();
}
+   $a = new Phar(dirname(__FILE__) . '/files/bz2_alias.phar.zip');
+   

[PHP-CVS] cvs: php-src /ext/phar phar_internal.h zip.c /ext/phar/tests/zip bzip2.phpt /ext/phar/tests/zip/files bz2_alias.phar.zip

2008-09-14 Thread Greg Beaver
cellog  Sun Sep 14 06:32:53 2008 UTC

  Modified files:  
/php-src/ext/phar   phar_internal.h zip.c 
/php-src/ext/phar/tests/zip bzip2.phpt 
/php-src/ext/phar/tests/zip/files   bz2_alias.phar.zip 
  Log:
  MFB: increase code coverage, fix bzip2-compressed alias in zip
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_internal.h?r1=1.117r2=1.118diff_format=u
Index: php-src/ext/phar/phar_internal.h
diff -u php-src/ext/phar/phar_internal.h:1.117 
php-src/ext/phar/phar_internal.h:1.118
--- php-src/ext/phar/phar_internal.h:1.117  Sat Sep 13 22:31:18 2008
+++ php-src/ext/phar/phar_internal.hSun Sep 14 06:32:52 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: phar_internal.h,v 1.117 2008/09/13 22:31:18 cellog Exp $ */
+/* $Id: phar_internal.h,v 1.118 2008/09/14 06:32:52 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -555,7 +555,7 @@
 static inline int phar_validate_alias(const char *alias, int alias_len) /* {{{ 
*/
 {
return !(memchr(alias, '/', alias_len) || memchr(alias, '\\', 
alias_len) || memchr(alias, ':', alias_len) ||
-   memchr(alias, ';', alias_len));
+   memchr(alias, ';', alias_len) || memchr(alias, '\n', alias_len) 
|| memchr(alias, '\r', alias_len));
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/zip.c?r1=1.53r2=1.54diff_format=u
Index: php-src/ext/phar/zip.c
diff -u php-src/ext/phar/zip.c:1.53 php-src/ext/phar/zip.c:1.54
--- php-src/ext/phar/zip.c:1.53 Sun Aug 31 20:54:27 2008
+++ php-src/ext/phar/zip.c  Sun Sep 14 06:32:52 2008
@@ -465,10 +465,27 @@
if (!actual_alias  entry.filename_len == 
sizeof(.phar/alias.txt)-1  !strncmp(entry.filename, .phar/alias.txt, 
sizeof(.phar/alias.txt)-1)) {
php_stream_filter *filter;
off_t saveloc;
+   /* verify local file header */
+   phar_zip_file_header local;
 
-   /* archive alias found, seek to file contents, do not 
validate local header. Potentially risky, but not very. */
+   /* archive alias found */
saveloc = php_stream_tell(fp);
-   php_stream_seek(fp, PHAR_GET_32(zipentry.offset) + 
sizeof(phar_zip_file_header) + entry.filename_len + 
PHAR_GET_16(zipentry.extra_len), SEEK_SET);
+   php_stream_seek(fp, PHAR_GET_32(zipentry.offset), 
SEEK_SET);
+
+   if (sizeof(local) != php_stream_read(fp, (char *) 
local, sizeof(local))) {
+   PHAR_ZIP_FAIL(phar error: internal corruption 
of zip-based phar (cannot read local file header for alias));
+   }
+
+   /* verify local header */
+   if (entry.filename_len != 
PHAR_GET_16(local.filename_len) || entry.crc32 != PHAR_GET_32(local.crc32) || 
entry.uncompressed_filesize != PHAR_GET_32(local.uncompsize) || 
entry.compressed_filesize != PHAR_GET_32(local.compsize)) {
+   PHAR_ZIP_FAIL(phar error: internal corruption 
of zip-based phar (local head of alias does not match central directory));
+   }
+
+   /* construct actual offset to file start - local 
extra_len can be different from central extra_len */
+   entry.offset = entry.offset_abs =
+   sizeof(local) + entry.header_offset + 
PHAR_GET_16(local.filename_len) + PHAR_GET_16(local.extra_len);
+   php_stream_seek(fp, entry.offset, SEEK_SET);
+
mydata-alias_len = entry.uncompressed_filesize;
 
if (entry.flags  PHAR_ENT_COMPRESSED_GZ) {
@@ -498,7 +515,6 @@
}
 
php_stream_filter_append(fp-readfilters, 
filter);
-   php_stream_filter_append(fp-readfilters, 
filter);
 
if (!(entry.uncompressed_filesize = 
php_stream_copy_to_mem(fp, actual_alias, entry.uncompressed_filesize, 0)) || 
!actual_alias) {
pefree(entry.filename, 
entry.is_persistent);
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/zip/bzip2.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/phar/tests/zip/bzip2.phpt
diff -u php-src/ext/phar/tests/zip/bzip2.phpt:1.2 
php-src/ext/phar/tests/zip/bzip2.phpt:1.3
--- php-src/ext/phar/tests/zip/bzip2.phpt:1.2   Sun Aug 31 20:54:28 2008
+++ php-src/ext/phar/tests/zip/bzip2.phpt   Sun Sep 14 06:32:52 2008
@@ -11,6 +11,8 @@
foreach ($a as $entry = $file) {
echo $file-getContent();
}
+   $a = new Phar(dirname(__FILE__) . '/files/bz2_alias.phar.zip');
+   var_dump($a-getAlias());
 } catch (Exception $e) {
echo $e-getMessage() . \n;
 }
@@ -77,4 +79,5 @@
 $a-addFile('hi', null, 'hii', null, 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar pharzip.h tar.h

2008-09-14 Thread Greg Beaver
cellog  Sun Sep 14 06:46:44 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/phar   pharzip.h tar.h 
  Log:
  fix compile on IRIX with MIPSPro (Bug #46072)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/pharzip.h?r1=1.2r2=1.2.2.1diff_format=u
Index: php-src/ext/phar/pharzip.h
diff -u php-src/ext/phar/pharzip.h:1.2 php-src/ext/phar/pharzip.h:1.2.2.1
--- php-src/ext/phar/pharzip.h:1.2  Mon Jan 28 08:52:06 2008
+++ php-src/ext/phar/pharzip.h  Sun Sep 14 06:46:43 2008
@@ -17,14 +17,20 @@
   +--+
 */
 
-/* $Id: pharzip.h,v 1.2 2008/01/28 08:52:06 cellog Exp $ */
+/* $Id: pharzip.h,v 1.2.2.1 2008/09/14 06:46:43 cellog Exp $ */
 
 #ifdef PHP_WIN32
 #pragma pack(1)
 # define PHAR_ZIP_PACK
+#elif defined(__sgi)
+# define PHAR_ZIP_PACK
 #else
 # define PHAR_ZIP_PACK __attribute__((__packed__))
 #endif
+
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_file_header {
char signature[4];   /* local file header signature 4 bytes  
(0x04034b50) */
char zipversion[2];  /* version needed to extract   2 bytes */
@@ -41,6 +47,9 @@
 /* extra field (variable size) */
 } PHAR_ZIP_PACK phar_zip_file_header;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_file_datadesc {
php_uint32 crc32;  /* crc-32  4 bytes */
php_uint32 compsize;   /* compressed size 4 bytes */
@@ -55,6 +64,9 @@
php_uint32 uncompsize2;
 } PHAR_ZIP_PACK phar_zip_data_desc_zip64;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_archive_extra_data_record {
char signature[4];   /* archive extra data signature4 bytes  
(0x08064b50) */
php_uint32 len;  /* extra field length  4 bytes */
@@ -135,11 +147,17 @@
the CRC; i.e., it may be four bytes too small.]
 */
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_extra_field_header {
char tag[2];
php_uint16 size;
 } PHAR_ZIP_PACK phar_zip_extra_field_header;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_unix3 {
char tag[2];/* 0x756eShort   tag for this extra 
block type (nu) */
php_uint16 size;/* TSize Short   total data size 
for this block */
@@ -151,6 +169,9 @@
 /* (var.)variablesymbolic link filename */
 } PHAR_ZIP_PACK phar_zip_unix3;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_central_dir_file {
char signature[4];/* central file header signature   4 
bytes  (0x02014b50) */
char madeby[2];   /* version made by 2 
bytes */
@@ -175,11 +196,17 @@
 /* file comment (variable size) */
 } PHAR_ZIP_PACK phar_zip_central_dir_file;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_dir_signature {
char signature[4];  /* header signature4 bytes  
(0x05054b50) */
php_uint16 size;/* size of data2 bytes */
 } PHAR_ZIP_PACK phar_zip_dir_signature;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip64_dir_end {
char signature[4];/* zip64 end of central dir 
  signature   4 bytes  
(0x06064b50) */
@@ -206,6 +233,9 @@
 /* zip64 extensible data sector(variable size) */
 } PHAR_ZIP_PACK phar_zip64_dir_end;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip64_dir_locator {
char signature[4]; /* zip64 end of central dir locator 
   signature   4 bytes  
(0x07064b50) */
@@ -218,6 +248,9 @@
php_uint32 totaldisks; /* total number of disks   4 bytes */
 } PHAR_ZIP_PACK phar_zip64_dir_locator;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_dir_end {
char signature[4];   /* end of central dir signature4 bytes 
 (0x06054b50) */
php_uint16 disknumber;   /* number of this disk 2 bytes 
*/
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.h?r1=1.4r2=1.4.2.1diff_format=u
Index: php-src/ext/phar/tar.h
diff -u php-src/ext/phar/tar.h:1.4 php-src/ext/phar/tar.h:1.4.2.1
--- php-src/ext/phar/tar.h:1.4  Mon Mar 10 19:11:15 2008
+++ php-src/ext/phar/tar.h  Sun Sep 14 06:46:43 2008
@@ -22,9 +22,15 @@
 #ifdef PHP_WIN32
 #pragma pack(1)
 # define PHAR_TAR_PACK
+#elif defined(__sgi)
+# define PHAR_TAR_PACK
 #else
 # define PHAR_TAR_PACK __attribute__((__packed__))
 #endif
+
+#if defined(__sgi)
+# pragma pack 0
+#endif
 /**
  * the format of the header block for a file, in the older UNIX-compatible
  * TAR format
@@ -46,6 +52,9 @@
 } PHAR_TAR_PACK old_tar_header;
 /* }}} */
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 /**
  * the new USTAR header format.
  * Note that tar can 

[PHP-CVS] cvs: php-src /ext/phar pharzip.h tar.h

2008-09-14 Thread Greg Beaver
cellog  Sun Sep 14 06:46:57 2008 UTC

  Modified files:  
/php-src/ext/phar   pharzip.h tar.h 
  Log:
  MFB: fix compile on IRIX with MIPSPro (Bug #46072)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/pharzip.h?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/phar/pharzip.h
diff -u php-src/ext/phar/pharzip.h:1.2 php-src/ext/phar/pharzip.h:1.3
--- php-src/ext/phar/pharzip.h:1.2  Mon Jan 28 08:52:06 2008
+++ php-src/ext/phar/pharzip.h  Sun Sep 14 06:46:57 2008
@@ -17,14 +17,20 @@
   +--+
 */
 
-/* $Id: pharzip.h,v 1.2 2008/01/28 08:52:06 cellog Exp $ */
+/* $Id: pharzip.h,v 1.3 2008/09/14 06:46:57 cellog Exp $ */
 
 #ifdef PHP_WIN32
 #pragma pack(1)
 # define PHAR_ZIP_PACK
+#elif defined(__sgi)
+# define PHAR_ZIP_PACK
 #else
 # define PHAR_ZIP_PACK __attribute__((__packed__))
 #endif
+
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_file_header {
char signature[4];   /* local file header signature 4 bytes  
(0x04034b50) */
char zipversion[2];  /* version needed to extract   2 bytes */
@@ -41,6 +47,9 @@
 /* extra field (variable size) */
 } PHAR_ZIP_PACK phar_zip_file_header;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_file_datadesc {
php_uint32 crc32;  /* crc-32  4 bytes */
php_uint32 compsize;   /* compressed size 4 bytes */
@@ -55,6 +64,9 @@
php_uint32 uncompsize2;
 } PHAR_ZIP_PACK phar_zip_data_desc_zip64;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_archive_extra_data_record {
char signature[4];   /* archive extra data signature4 bytes  
(0x08064b50) */
php_uint32 len;  /* extra field length  4 bytes */
@@ -135,11 +147,17 @@
the CRC; i.e., it may be four bytes too small.]
 */
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_extra_field_header {
char tag[2];
php_uint16 size;
 } PHAR_ZIP_PACK phar_zip_extra_field_header;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_unix3 {
char tag[2];/* 0x756eShort   tag for this extra 
block type (nu) */
php_uint16 size;/* TSize Short   total data size 
for this block */
@@ -151,6 +169,9 @@
 /* (var.)variablesymbolic link filename */
 } PHAR_ZIP_PACK phar_zip_unix3;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_central_dir_file {
char signature[4];/* central file header signature   4 
bytes  (0x02014b50) */
char madeby[2];   /* version made by 2 
bytes */
@@ -175,11 +196,17 @@
 /* file comment (variable size) */
 } PHAR_ZIP_PACK phar_zip_central_dir_file;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_dir_signature {
char signature[4];  /* header signature4 bytes  
(0x05054b50) */
php_uint16 size;/* size of data2 bytes */
 } PHAR_ZIP_PACK phar_zip_dir_signature;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip64_dir_end {
char signature[4];/* zip64 end of central dir 
  signature   4 bytes  
(0x06064b50) */
@@ -206,6 +233,9 @@
 /* zip64 extensible data sector(variable size) */
 } PHAR_ZIP_PACK phar_zip64_dir_end;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip64_dir_locator {
char signature[4]; /* zip64 end of central dir locator 
   signature   4 bytes  
(0x07064b50) */
@@ -218,6 +248,9 @@
php_uint32 totaldisks; /* total number of disks   4 bytes */
 } PHAR_ZIP_PACK phar_zip64_dir_locator;
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 typedef struct _phar_zip_dir_end {
char signature[4];   /* end of central dir signature4 bytes 
 (0x06054b50) */
php_uint16 disknumber;   /* number of this disk 2 bytes 
*/
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.h?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/phar/tar.h
diff -u php-src/ext/phar/tar.h:1.4 php-src/ext/phar/tar.h:1.5
--- php-src/ext/phar/tar.h:1.4  Mon Mar 10 19:11:15 2008
+++ php-src/ext/phar/tar.h  Sun Sep 14 06:46:57 2008
@@ -22,9 +22,15 @@
 #ifdef PHP_WIN32
 #pragma pack(1)
 # define PHAR_TAR_PACK
+#elif defined(__sgi)
+# define PHAR_TAR_PACK
 #else
 # define PHAR_TAR_PACK __attribute__((__packed__))
 #endif
+
+#if defined(__sgi)
+# pragma pack 0
+#endif
 /**
  * the format of the header block for a file, in the older UNIX-compatible
  * TAR format
@@ -46,6 +52,9 @@
 } PHAR_TAR_PACK old_tar_header;
 /* }}} */
 
+#if defined(__sgi)
+# pragma pack 0
+#endif
 /**
  * the new USTAR header format.
  * Note that tar can determine that the USTAR format is 

[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS

2008-09-14 Thread Greg Beaver
cellog  Sun Sep 14 06:47:08 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  fix compile on IRIX with MIPSPro (Bug #46072)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.316r2=1.2027.2.547.2.965.2.317diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.316 
php-src/NEWS:1.2027.2.547.2.965.2.317
--- php-src/NEWS:1.2027.2.547.2.965.2.316   Sat Sep 13 20:57:41 2008
+++ php-src/NEWSSun Sep 14 06:47:08 2008
@@ -5,6 +5,7 @@
 - Changed error level E_ERROR into E_WARNING in Soap extension methods 
   parameter validation. (Felipe)
 
+- Fixed bug #46072 (Compile failure under IRIX 6.5.30 building util.c) (Greg)
 - Fixed bug #46060 (Phar::addEmptyDir() breaks) (Greg)
 - Fixed bug #46042 (memory leaks with reflection of mb_convert_encoding()).
   (Ilia)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /main php_compat.h

2008-09-14 Thread Nuno Lopes
nlopess Sun Sep 14 14:15:52 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main   php_compat.h 
  Log:
  update list of pcre symbols
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_compat.h?r1=1.25.2.3.2.4.2.2r2=1.25.2.3.2.4.2.3diff_format=u
Index: php-src/main/php_compat.h
diff -u php-src/main/php_compat.h:1.25.2.3.2.4.2.2 
php-src/main/php_compat.h:1.25.2.3.2.4.2.3
--- php-src/main/php_compat.h:1.25.2.3.2.4.2.2  Thu Jul 17 14:34:51 2008
+++ php-src/main/php_compat.h   Sun Sep 14 14:15:52 2008
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_compat.h,v 1.25.2.3.2.4.2.2 2008/07/17 14:34:51 nlopess Exp $ */
+/* $Id: php_compat.h,v 1.25.2.3.2.4.2.3 2008/09/14 14:15:52 nlopess Exp $ */
 
 #ifndef PHP_COMPAT_H
 #define PHP_COMPAT_H
@@ -28,32 +28,30 @@
 #endif
 
 #if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION)
-#define pcre_compile   php_pcre_compile
-#define pcre_compile2  php_pcre_compile2
+#define pcre_compile   php_pcre_compile
+#define pcre_compile2  php_pcre_compile2
 #define pcre_copy_substringphp_pcre_copy_substring
-#define pcre_exec  php_pcre_exec
+#define pcre_exec  php_pcre_exec
 #define pcre_get_substring php_pcre_get_substring
-#define pcre_get_substring_listphp_pcre_get_substring_list
-#define pcre_info  php_pcre_info
+#define pcre_get_substring_listphp_pcre_get_substring_list
+#define pcre_info  php_pcre_info
 #define pcre_maketablesphp_pcre_maketables
-#define pcre_study php_pcre_study
+#define pcre_study php_pcre_study
 #define pcre_version   php_pcre_version
 #define pcre_fullinfo  php_pcre_fullinfo
-#define pcre_free  php_pcre_free
-#define pcre_mallocphp_pcre_malloc
-#define pcre_configphp_pcre_config
-#define pcre_copy_named_substring php_pcre_copy_named_substring
-#define pcre_free_substringphp_pcre_free_substring
-#define pcre_free_substring_list php_pcre_free_substring_list
-#define pcre_get_named_substring php_pcre_get_named_substring
-#define pcre_get_stringnumber  php_pcre_get_stringnumber
-#define pcre_refcount  php_pcre_refcount
-#define _pcre_ord2utf8 php__pcre_ord2utf8
-#define _pcre_try_flipped  php__pcre_try_flipped
-#define _pcre_ucp_findprop php__pcre_ucp_findprop
-#define _pcre_ucp_othercasephp__pcre_ucp_othercase
-#define _pcre_valid_utf8   php__pcre_valid_utf8
-#define _pcre_xclass   php__pcre_xclass
+#define pcre_free  php_pcre_free
+#define pcre_mallocphp_pcre_malloc
+#define pcre_configphp_pcre_config
+#define pcre_copy_named_substring  php_pcre_copy_named_substring
+#define pcre_free_substringphp_pcre_free_substring
+#define pcre_free_substring_list   php_pcre_free_substring_list
+#define pcre_get_named_substring   php_pcre_get_named_substring
+#define pcre_get_stringnumber  php_pcre_get_stringnumber
+#define pcre_refcount  php_pcre_refcount
+#define _pcre_ord2utf8 php__pcre_ord2utf8
+#define _pcre_try_flipped  php__pcre_try_flipped
+#define _pcre_valid_utf8   php__pcre_valid_utf8
+#define _pcre_xclass   php__pcre_xclass
 #define pcre_callout   php_pcre_callout
 #define _pcre_OP_lengths   php__pcre_OP_lengths
 #define _pcre_utt_namesphp__pcre_utt_names
@@ -70,6 +68,10 @@
 #define _pcre_utt  php__pcre_utt
 #define _pcre_utt_size php__pcre_utt_size
 #define _pcre_was_newline  php__pcre_was_newline
+#define _pcre_ucd_records  php__pcre_ucd_records
+#define _pcre_ucd_stage1   php__pcre_ucd_stage1
+#define _pcre_ucd_stage2   php__pcre_ucd_stage2
+#define _pcre_ucp_gentype  php__pcre_ucp_gentype
 #endif
 
 #define lookup php_lookup



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /main rfc1867.c

2008-09-14 Thread Arnaud Le Blanc
lbarnaudSun Sep 14 14:55:29 2008 UTC

  Modified files:  
/php-src/main   rfc1867.c 
  Log:
  Fix invalid read in freed area
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/rfc1867.c?r1=1.200r2=1.201diff_format=u
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.200 php-src/main/rfc1867.c:1.201
--- php-src/main/rfc1867.c:1.200Mon Sep  8 09:20:33 2008
+++ php-src/main/rfc1867.c  Sun Sep 14 14:55:28 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: rfc1867.c,v 1.200 2008/09/08 09:20:33 lbarnaud Exp $ */
+/* $Id: rfc1867.c,v 1.201 2008/09/14 14:55:28 lbarnaud Exp $ */
 
 /*
  *  This product includes software developed by the Apache Group
@@ -1507,11 +1507,6 @@
register_u_http_post_files_variable(lbuf, ucd, ucd_len, 
http_post_files, 0 TSRMLS_CC);
 
efree(ucd);
-
-   /* Restore Content-Type Header */
-   if (s != NULL) {
-   *s = 0x3b /*';'*/;
-   }
s = EMPTY_STR;
 
/* Initialize variables */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard file.c

2008-09-14 Thread Arnaud Le Blanc
lbarnaudSun Sep 14 14:55:50 2008 UTC

  Modified files:  
/php-src/ext/standard   file.c 
  Log:
  Fix leak in fgetc()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.528r2=1.529diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.528 php-src/ext/standard/file.c:1.529
--- php-src/ext/standard/file.c:1.528   Fri Sep 12 10:30:18 2008
+++ php-src/ext/standard/file.c Sun Sep 14 14:55:50 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: file.c,v 1.528 2008/09/12 10:30:18 tony2001 Exp $ */
+/* $Id: file.c,v 1.529 2008/09/14 14:55:50 lbarnaud Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1185,6 +1185,9 @@
UChar *buf = php_stream_read_unicode_chars(stream, buflen);
 
if (!buf || !buflen) {
+   if (buf) {
+   efree(buf);
+   }
RETURN_FALSE;
}
RETURN_UNICODEL(buf, buflen, 0);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard string.c

2008-09-14 Thread Arnaud Le Blanc
lbarnaudSun Sep 14 14:56:34 2008 UTC

  Modified files:  
/php-src/ext/standard   string.c 
  Log:
  Fix str len in stripos when $offset argument is given
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.681r2=1.682diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.681 php-src/ext/standard/string.c:1.682
--- php-src/ext/standard/string.c:1.681 Sat Aug 16 21:16:24 2008
+++ php-src/ext/standard/string.c   Sun Sep 14 14:56:34 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.681 2008/08/16 21:16:24 felipe Exp $ */
+/* $Id: string.c,v 1.682 2008/09/14 14:56:34 lbarnaud Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -2664,7 +2664,7 @@
if (Z_TYPE_PP(haystack) == IS_UNICODE) {
/* calculate code unit offset */
U16_FWD_N(Z_USTRVAL_PP(haystack), cu_offset, 
haystack_len, offset);
-   found = php_u_stristr(Z_USTRVAL_PP(haystack) + 
cu_offset, Z_USTRVAL_PP(needle), haystack_len, needle_len, 1 TSRMLS_CC);
+   found = php_u_stristr(Z_USTRVAL_PP(haystack) + 
cu_offset, Z_USTRVAL_PP(needle), haystack_len - cu_offset, needle_len, 1 
TSRMLS_CC);
} else {
haystack_dup = estrndup(Z_STRVAL_PP(haystack), 
haystack_len);
php_strtolower((char *)haystack_dup, haystack_len);
@@ -2686,7 +2686,7 @@
/* calculate code unit offset */
U16_FWD_N(Z_USTRVAL_PP(haystack), cu_offset, 
haystack_len, offset);
found = php_u_stristr(Z_USTRVAL_PP(haystack) + 
cu_offset,
- 
u_needle_char, haystack_len, needle_len, 1 TSRMLS_CC);
+ 
u_needle_char, haystack_len - cu_offset, needle_len, 1 TSRMLS_CC);
} else {
c = tolower((char)Z_LVAL_PP(needle));
needle_char[0] = c;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard/tests/strings stripos_variation1.phpt stripos_variation11.phpt stripos_variation12.phpt stripos_variation2.phpt

2008-09-14 Thread Arnaud Le Blanc
lbarnaudSun Sep 14 14:57:26 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/strings stripos_variation11.phpt 
stripos_variation12.phpt 
stripos_variation1.phpt 
stripos_variation2.phpt 
  Log:
  MFB / fix tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/stripos_variation11.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/strings/stripos_variation11.phpt
diff -u php-src/ext/standard/tests/strings/stripos_variation11.phpt:1.3 
php-src/ext/standard/tests/strings/stripos_variation11.phpt:1.4
--- php-src/ext/standard/tests/strings/stripos_variation11.phpt:1.3 Tue May 
27 10:50:47 2008
+++ php-src/ext/standard/tests/strings/stripos_variation11.phpt Sun Sep 14 
14:57:26 2008
@@ -92,7 +92,7 @@
 *** Testing stripos() function with unexpected values for haystack and needle 
***
 -- Iteration 1 --
 bool(false)
-int(1)
+bool(false)
 -- Iteration 2 --
 bool(false)
 bool(false)
@@ -125,17 +125,17 @@
 bool(false)
 -- Iteration 8 --
 bool(false)
-int(7)
+bool(false)
 -- Iteration 9 --
 bool(false)
-int(3)
+bool(false)
 -- Iteration 10 --
 
 Notice: Array to string conversion in %s on line %d
 bool(false)
 
 Notice: Array to string conversion in %s on line %d
-int(5)
+bool(false)
 -- Iteration 11 --
 
 Notice: Array to string conversion in %s on line %d
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/stripos_variation12.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/strings/stripos_variation12.phpt
diff -u php-src/ext/standard/tests/strings/stripos_variation12.phpt:1.3 
php-src/ext/standard/tests/strings/stripos_variation12.phpt:1.4
--- php-src/ext/standard/tests/strings/stripos_variation12.phpt:1.3 Tue May 
27 10:50:47 2008
+++ php-src/ext/standard/tests/strings/stripos_variation12.phpt Sun Sep 14 
14:57:26 2008
@@ -31,15 +31,15 @@
 int(5)
 int(5)
 int(0)
-int(12)
+bool(false)
 int(11)
 int(11)
 int(0)
-int(3)
+bool(false)
 int(5)
 int(5)
 int(0)
-int(6)
+bool(false)
 int(5)
-int(6)
+bool(false)
 *** Done ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/stripos_variation1.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/strings/stripos_variation1.phpt
diff -u php-src/ext/standard/tests/strings/stripos_variation1.phpt:1.3 
php-src/ext/standard/tests/strings/stripos_variation1.phpt:1.4
--- php-src/ext/standard/tests/strings/stripos_variation1.phpt:1.3  Tue May 
27 10:50:46 2008
+++ php-src/ext/standard/tests/strings/stripos_variation1.phpt  Sun Sep 14 
14:57:26 2008
@@ -7,10 +7,10 @@
  * Source code: ext/standard/string.c
 */
 
-/* Test stripos() function by passing double quoted strings to 'haystack'  
'needle' arguments */
+/* Test stripos() function by passing double quoted strings for 'haystack'  
'needle' arguments */
 
 echo *** Testing stripos() function: with double quoted strings ***\n;
-$haystack = Hello,\t\n\0\n  $!#%\o,()*+-./:;=[EMAIL PROTECTED] \x234 \101;
+$haystack = Hello,\t\n\0\n  $!#%\o,()*+-./:;=[EMAIL PROTECTED] \x234 \101 
;
 $needle = array(
   //regular strings
   l,
@@ -50,6 +50,7 @@
   (),
   *+,
   +,
+  -,
   .,
   .;,
   :;,
@@ -57,6 +58,8 @@
   =,
   ,
   =,
+  ?,
+  @,
   @hEllo,
 
   12345, //decimal numeric string
@@ -68,7 +71,7 @@
   $haystack  //haystack as needle
 );
  
-/* loop through 'needle' array to get the position of the needle in haystack 
string */
+/* loop through to get the position of the needle in haystack string */
 $count = 1;
 for($index=0; $indexcount($needle); $index++) {
   echo -- Iteration $count --\n;
@@ -78,7 +81,7 @@
 }
 echo *** Done ***;
 ?
---EXPECT--
+--EXPECTF--
 *** Testing stripos() function: with double quoted strings ***
 -- Iteration 1 --
 int(2)
@@ -112,19 +115,19 @@
 int(9)
 -- Iteration 11 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 12 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 13 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 14 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 15 --
 int(8)
-int(52)
+bool(false)
 -- Iteration 16 --
 bool(false)
 bool(false)
@@ -159,48 +162,57 @@
 int(23)
 bool(false)
 -- Iteration 27 --
-int(25)
+int(24)
 bool(false)
 -- Iteration 28 --
-bool(false)
+int(25)
 bool(false)
 -- Iteration 29 --
-int(27)
+bool(false)
 bool(false)
 -- Iteration 30 --
-int(28)
+int(27)
 bool(false)
 -- Iteration 31 --
-int(29)
+int(28)
 bool(false)
 -- Iteration 32 --
-int(31)
-int(31)
+int(29)
+bool(false)
 -- Iteration 33 --
-int(30)
+int(31)
 bool(false)
 -- Iteration 34 --
+int(30)
+bool(false)
+-- Iteration 35 --
+int(32)
+bool(false)
+-- Iteration 36 --
 int(33)
+bool(false)
+-- Iteration 37 --
 int(33)
--- Iteration 35 --
+bool(false)
+-- Iteration 38 --
 int(39)
 int(39)
--- Iteration 36 --
+-- Iteration 39 --
 int(15)
 int(48)
--- Iteration 37 --
+-- Iteration 40 --
 int(15)
 int(48)
--- Iteration 38 --
+-- Iteration 41 --
 int(51)
 int(51)