Merge branch 'PHP-5.3' of https://git.php.net/repository/php-src into PHP-5.3

* 'PHP-5.3' of https://git.php.net/repository/php-src:
  - Updated to version 2012.7 (2012g)
  SUpport newer bisons.
  Merge the fix for #61964 to 5.3, which will fix #63304
  indent
  better fix for #63055
  Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite)
  PHP 5.3.18 NEWS
  fix NEWS
  fix compilation failure on 32/64bit linux systems, when libmysql is used  with ext/mysql
  Cover have_ssl=NO and have_ssl=DISABLED
  Minor changes for MySQL 5.6
  NEWS for 76601c4
  Fix bug #63240 on stream_get_line()
  extended the SKIPIF section with ICU 49 (sync with 5.4 branch)
  fixed tests for gd having freetype >= 2.4.10
This commit is contained in:
Christopher Jones 2012-10-18 17:37:21 -07:00
commit 79a048f76f
24 changed files with 430 additions and 110 deletions

24
NEWS
View File

@ -2,14 +2,22 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2012, PHP 5.3.19
- MySQL:
. Fixed compilation failure on mixed 32/64 bit systems. (Andrey)
- PCRE:
. Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite).
(Dmitry, Laruence)
- PDO:
. Fixed bug #63235 (buffer overflow in use of SQLGetDiagRec).
(Martin Osvald, Remi)
?? ??? 2012, PHP 5.3.18
- Streams:
. Fixed bug #63240 (stream_get_line() return contains delimiter string).
(Tjerk, Gustavo)
(NOTE: Add your entries above for 5.3.19, entries for 5.3.18 should only
be added after merge by RM)
18 Oct 2012, PHP 5.3.18
- Core:
. Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry)
@ -62,9 +70,13 @@ be added after merge by RM)
- CURL:
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
- Intl:
. Fix null pointer dereferences in some classes of ext/intl. (Gustavo)
. Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false).
(r.hampartsumyan@gmail.com, Laruence)
- DateTime:
. Fixed bug #62852 (Unserialize invalid DateTime causes crash).
(reeze.xia@gmail.com)
. Fixed bug #62500 (Segfault in DateInterval class when extended). (Laruence)
- MySQLnd:
. Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence)

View File

@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5"
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed

View File

@ -40,6 +40,8 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
TSRMLS_FETCH();
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
/* break possible cycles */
Z_TYPE_P(zvalue) = IS_NULL;
zend_hash_destroy(zvalue->value.ht);
FREE_HASHTABLE(zvalue->value.ht);
}

View File

@ -507,77 +507,77 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[576] = {
{ "NZ" , 0x038F1A },
{ "NZ-CHAT" , 0x039298 },
{ "Pacific/Apia" , 0x039580 },
{ "Pacific/Auckland" , 0x03961D },
{ "Pacific/Chatham" , 0x0399A9 },
{ "Pacific/Chuuk" , 0x039CA0 },
{ "Pacific/Easter" , 0x039CF9 },
{ "Pacific/Efate" , 0x03A057 },
{ "Pacific/Enderbury" , 0x03A11D },
{ "Pacific/Fakaofo" , 0x03A18B },
{ "Pacific/Fiji" , 0x03A1DC },
{ "Pacific/Funafuti" , 0x03A36F },
{ "Pacific/Galapagos" , 0x03A3B3 },
{ "Pacific/Gambier" , 0x03A42B },
{ "Pacific/Guadalcanal" , 0x03A490 },
{ "Pacific/Guam" , 0x03A4E5 },
{ "Pacific/Honolulu" , 0x03A53B },
{ "Pacific/Johnston" , 0x03A5B2 },
{ "Pacific/Kiritimati" , 0x03A604 },
{ "Pacific/Kosrae" , 0x03A66F },
{ "Pacific/Kwajalein" , 0x03A6CC },
{ "Pacific/Majuro" , 0x03A738 },
{ "Pacific/Marquesas" , 0x03A797 },
{ "Pacific/Midway" , 0x03A7FE },
{ "Pacific/Nauru" , 0x03A888 },
{ "Pacific/Niue" , 0x03A900 },
{ "Pacific/Norfolk" , 0x03A95E },
{ "Pacific/Noumea" , 0x03A9B3 },
{ "Pacific/Pago_Pago" , 0x03AA43 },
{ "Pacific/Palau" , 0x03AACC },
{ "Pacific/Pitcairn" , 0x03AB10 },
{ "Pacific/Pohnpei" , 0x03AB65 },
{ "Pacific/Ponape" , 0x03ABBA },
{ "Pacific/Port_Moresby" , 0x03ABFF },
{ "Pacific/Rarotonga" , 0x03AC43 },
{ "Pacific/Saipan" , 0x03AD1F },
{ "Pacific/Samoa" , 0x03AD82 },
{ "Pacific/Tahiti" , 0x03AE0B },
{ "Pacific/Tarawa" , 0x03AE70 },
{ "Pacific/Tongatapu" , 0x03AEC4 },
{ "Pacific/Truk" , 0x03AF50 },
{ "Pacific/Wake" , 0x03AF95 },
{ "Pacific/Wallis" , 0x03AFE5 },
{ "Pacific/Yap" , 0x03B029 },
{ "Poland" , 0x03B06E },
{ "Portugal" , 0x03B44F },
{ "PRC" , 0x03B94B },
{ "PST8PDT" , 0x03B9FC },
{ "ROC" , 0x03BD4D },
{ "ROK" , 0x03BE65 },
{ "Singapore" , 0x03BF09 },
{ "Turkey" , 0x03BFC0 },
{ "UCT" , 0x03C3AD },
{ "Universal" , 0x03C3F1 },
{ "US/Alaska" , 0x03C435 },
{ "US/Aleutian" , 0x03C79E },
{ "US/Arizona" , 0x03CB04 },
{ "US/Central" , 0x03CB92 },
{ "US/East-Indiana" , 0x03D59C },
{ "US/Eastern" , 0x03D09D },
{ "US/Hawaii" , 0x03D806 },
{ "US/Indiana-Starke" , 0x03D877 },
{ "US/Michigan" , 0x03DBE8 },
{ "US/Mountain" , 0x03DF1F },
{ "US/Pacific" , 0x03E298 },
{ "US/Pacific-New" , 0x03E69D },
{ "US/Samoa" , 0x03EAA2 },
{ "UTC" , 0x03EB2B },
{ "W-SU" , 0x03EE22 },
{ "WET" , 0x03EB6F },
{ "Zulu" , 0x03F05C },
{ "Pacific/Auckland" , 0x03971C },
{ "Pacific/Chatham" , 0x039AA8 },
{ "Pacific/Chuuk" , 0x039D9F },
{ "Pacific/Easter" , 0x039DF8 },
{ "Pacific/Efate" , 0x03A156 },
{ "Pacific/Enderbury" , 0x03A21C },
{ "Pacific/Fakaofo" , 0x03A28A },
{ "Pacific/Fiji" , 0x03A2DB },
{ "Pacific/Funafuti" , 0x03A46E },
{ "Pacific/Galapagos" , 0x03A4B2 },
{ "Pacific/Gambier" , 0x03A52A },
{ "Pacific/Guadalcanal" , 0x03A58F },
{ "Pacific/Guam" , 0x03A5E4 },
{ "Pacific/Honolulu" , 0x03A63A },
{ "Pacific/Johnston" , 0x03A6B1 },
{ "Pacific/Kiritimati" , 0x03A703 },
{ "Pacific/Kosrae" , 0x03A76E },
{ "Pacific/Kwajalein" , 0x03A7CB },
{ "Pacific/Majuro" , 0x03A837 },
{ "Pacific/Marquesas" , 0x03A896 },
{ "Pacific/Midway" , 0x03A8FD },
{ "Pacific/Nauru" , 0x03A987 },
{ "Pacific/Niue" , 0x03A9FF },
{ "Pacific/Norfolk" , 0x03AA5D },
{ "Pacific/Noumea" , 0x03AAB2 },
{ "Pacific/Pago_Pago" , 0x03AB42 },
{ "Pacific/Palau" , 0x03ABCB },
{ "Pacific/Pitcairn" , 0x03AC0F },
{ "Pacific/Pohnpei" , 0x03AC64 },
{ "Pacific/Ponape" , 0x03ACB9 },
{ "Pacific/Port_Moresby" , 0x03ACFE },
{ "Pacific/Rarotonga" , 0x03AD42 },
{ "Pacific/Saipan" , 0x03AE1E },
{ "Pacific/Samoa" , 0x03AE81 },
{ "Pacific/Tahiti" , 0x03AF0A },
{ "Pacific/Tarawa" , 0x03AF6F },
{ "Pacific/Tongatapu" , 0x03AFC3 },
{ "Pacific/Truk" , 0x03B04F },
{ "Pacific/Wake" , 0x03B094 },
{ "Pacific/Wallis" , 0x03B0E4 },
{ "Pacific/Yap" , 0x03B128 },
{ "Poland" , 0x03B16D },
{ "Portugal" , 0x03B54E },
{ "PRC" , 0x03BA4A },
{ "PST8PDT" , 0x03BAFB },
{ "ROC" , 0x03BE4C },
{ "ROK" , 0x03BF64 },
{ "Singapore" , 0x03C008 },
{ "Turkey" , 0x03C0BF },
{ "UCT" , 0x03C4AC },
{ "Universal" , 0x03C4F0 },
{ "US/Alaska" , 0x03C534 },
{ "US/Aleutian" , 0x03C89D },
{ "US/Arizona" , 0x03CC03 },
{ "US/Central" , 0x03CC91 },
{ "US/East-Indiana" , 0x03D69B },
{ "US/Eastern" , 0x03D19C },
{ "US/Hawaii" , 0x03D905 },
{ "US/Indiana-Starke" , 0x03D976 },
{ "US/Michigan" , 0x03DCE7 },
{ "US/Mountain" , 0x03E01E },
{ "US/Pacific" , 0x03E397 },
{ "US/Pacific-New" , 0x03E79C },
{ "US/Samoa" , 0x03EBA1 },
{ "UTC" , 0x03EC2A },
{ "W-SU" , 0x03EF21 },
{ "WET" , 0x03EC6E },
{ "Zulu" , 0x03F15B },
};
/* This is a generated file, do not modify */
const unsigned char timelib_timezone_db_data_builtin[258208] = {
const unsigned char timelib_timezone_db_data_builtin[258463] = {
/* Africa/Abidjan */
@ -8085,7 +8085,7 @@ const unsigned char timelib_timezone_db_data_builtin[258208] = {
0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xF1, 0x5E, 0xE0,
0x48, 0xB7, 0x11, 0xD0, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x4A, 0x70, 0x4B, 0xAD, 0x2E, 0x9C,
0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x96, 0xF3, 0xDC, 0x4E, 0x35, 0xC2, 0x50, 0x4F, 0x74, 0xDB, 0x60,
0x50, 0x64, 0xBE, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01,
0x50, 0x5B, 0x91, 0xE0, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x01, 0x02,
@ -8142,7 +8142,7 @@ const unsigned char timelib_timezone_db_data_builtin[258208] = {
0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x46, 0xE8, 0x6F, 0x70, 0x47, 0xF1, 0x5E, 0xE0,
0x48, 0xBB, 0x06, 0x50, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xA0, 0x4A, 0x70, 0x4B, 0xAD, 0x2E, 0x9C,
0x4C, 0x61, 0xBD, 0xD0, 0x4D, 0x95, 0xA2, 0x5C, 0x4E, 0x35, 0xC2, 0x50, 0x4E, 0x5C, 0x0B, 0xE0,
0x4E, 0x85, 0x06, 0x80, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x64, 0xE8, 0x80, 0x00, 0x01, 0x00, 0x01,
0x4E, 0x85, 0x06, 0x80, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x5B, 0x91, 0xE0, 0x00, 0x01, 0x00, 0x01,
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04,
0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
@ -16559,14 +16559,30 @@ const unsigned char timelib_timezone_db_data_builtin[258208] = {
/* Pacific/Apia */
0x50, 0x48, 0x50, 0x31, 0x01, 0x57, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x91, 0x05, 0xFC, 0x00,
0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x91, 0x05, 0xFC, 0x00,
0xDA, 0x62, 0x04, 0x38, 0x4C, 0x9F, 0x27, 0xB0, 0x4D, 0x97, 0x2B, 0xE0, 0x4E, 0x7D, 0xE2, 0x60,
0x4E, 0xFD, 0x8B, 0xA0, 0x4F, 0x77, 0x0D, 0xE0, 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x05, 0xFF,
0xFF, 0x5F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, 0x00,
0x09, 0xFF, 0xFF, 0x73, 0x60, 0x01, 0x0D, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x0D, 0x00, 0x00, 0xB6,
0xD0, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x57, 0x53, 0x54, 0x00,
0x57, 0x53, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x74, 0x38, 0x9A, 0x00, 0x0C, 0x9D, 0x2A, 0x00, 0x00, 0x00, 0x00,
0x4E, 0xFD, 0x8B, 0xA0, 0x4F, 0x77, 0x0D, 0xE0, 0x50, 0x66, 0xFE, 0xE0, 0x51, 0x60, 0x2A, 0x60,
0x52, 0x46, 0xE0, 0xE0, 0x53, 0x40, 0x0C, 0x60, 0x54, 0x26, 0xC2, 0xE0, 0x55, 0x1F, 0xEE, 0x60,
0x56, 0x06, 0xA4, 0xE0, 0x56, 0xFF, 0xD0, 0x60, 0x57, 0xE6, 0x86, 0xE0, 0x58, 0xDF, 0xB2, 0x60,
0x59, 0xC6, 0x68, 0xE0, 0x5A, 0xBF, 0x94, 0x60, 0x5B, 0xAF, 0x85, 0x60, 0x5C, 0xA8, 0xB0, 0xE0,
0x5D, 0x8F, 0x67, 0x60, 0x5E, 0x88, 0x92, 0xE0, 0x5F, 0x6F, 0x49, 0x60, 0x60, 0x68, 0x74, 0xE0,
0x61, 0x4F, 0x2B, 0x60, 0x62, 0x48, 0x56, 0xE0, 0x63, 0x2F, 0x0D, 0x60, 0x64, 0x28, 0x38, 0xE0,
0x65, 0x0E, 0xEF, 0x60, 0x66, 0x11, 0x55, 0x60, 0x66, 0xF8, 0x0B, 0xE0, 0x67, 0xF1, 0x37, 0x60,
0x68, 0xD7, 0xED, 0xE0, 0x69, 0xD1, 0x19, 0x60, 0x6A, 0xB7, 0xCF, 0xE0, 0x6B, 0xB0, 0xFB, 0x60,
0x6C, 0x97, 0xB1, 0xE0, 0x6D, 0x90, 0xDD, 0x60, 0x6E, 0x77, 0x93, 0xE0, 0x6F, 0x70, 0xBF, 0x60,
0x70, 0x60, 0xB0, 0x60, 0x71, 0x59, 0xDB, 0xE0, 0x72, 0x40, 0x92, 0x60, 0x73, 0x39, 0xBD, 0xE0,
0x74, 0x20, 0x74, 0x60, 0x75, 0x19, 0x9F, 0xE0, 0x76, 0x00, 0x56, 0x60, 0x76, 0xF9, 0x81, 0xE0,
0x77, 0xE0, 0x38, 0x60, 0x78, 0xD9, 0x63, 0xE0, 0x79, 0xC0, 0x1A, 0x60, 0x7A, 0xB9, 0x45, 0xE0,
0x7B, 0xA9, 0x36, 0xE0, 0x7C, 0xA2, 0x62, 0x60, 0x7D, 0x89, 0x18, 0xE0, 0x7E, 0x82, 0x44, 0x60,
0x7F, 0x68, 0xFA, 0xE0, 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF,
0x5F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x5E, 0x48, 0x00, 0x04, 0xFF, 0xFF, 0x65, 0x50, 0x00, 0x09,
0xFF, 0xFF, 0x73, 0x60, 0x01, 0x0D, 0x00, 0x00, 0xC4, 0xE0, 0x01, 0x0D, 0x00, 0x00, 0xB6, 0xD0,
0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x57, 0x53, 0x54, 0x00, 0x57,
0x53, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x74, 0x38, 0x9A, 0x00, 0x0C, 0x9D, 0x2A, 0x00, 0x00, 0x00, 0x00,
/* Pacific/Auckland */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -18191,4 +18207,4 @@ const unsigned char timelib_timezone_db_data_builtin[258208] = {
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80,
0x00, 0x00, 0x00, 0x00, };
const timelib_tzdb timezonedb_builtin = { "2012.6", 576, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
const timelib_tzdb timezonedb_builtin = { "2012.7", 576, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };

View File

@ -753,7 +753,7 @@ private int
apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
const char *fn, int action)
{
int errs = 0;
int errs = 0, mflen = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
size_t files = 0, maxfiles = 0;
@ -782,7 +782,7 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
goto out;
}
while ((d = readdir(dir)) != NULL) {
if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) {
if ((mflen = snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name)) < 0) {
file_oomem(ms,
strlen(fn) + strlen(d->d_name) + 2);
errs++;
@ -804,14 +804,14 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
goto out;
}
}
filearr[files++] = mfn;
filearr[files++] = estrndup(mfn, mflen);
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
for (i = 0; i < files; i++) {
load_1(ms, action, filearr[i], &errs, &marray,
&marraycount);
free(filearr[i]);
efree(filearr[i]);
}
free(filearr);
} else
@ -886,9 +886,14 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
mentrycount += marray[i].cont_count;
}
out:
for (i = 0; i < marraycount; i++)
efree(marray[i].mp);
efree(marray);
for (i = 0; i < marraycount; i++) {
if (marray[i].mp) {
efree(marray[i].mp);
}
}
if (marray) {
efree(marray);
}
if (errs) {
*magicp = NULL;
*nmagicp = 0;
@ -1165,6 +1170,9 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
return -1;
}
me = &(*mentryp)[*nmentryp - 1];
if (me->mp == NULL) {
return -1;
}
if (me->cont_count == me->max_count) {
struct magic *nm;
size_t cnt = me->max_count + ALLOC_CHUNK;
@ -1329,6 +1337,10 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
if (m->type == FILE_INVALID) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "type `%s' invalid", l);
if (me->mp) {
efree(me->mp);
me->mp = NULL;
}
return -1;
}
@ -2219,6 +2231,7 @@ apprentice_map(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
mm = emalloc((size_t)st.sb.st_size);
if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) {
file_badread(ms);
ret = 1;
goto error1;
}
ret = 1;

View File

@ -0,0 +1,69 @@
--TEST--
Bug #61964 (finfo_open with directory cause invalid free)
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$magic_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
$ret = @finfo_open(FILEINFO_NONE, $magic_file . ".non-exits");
var_dump($ret);
$dir = __DIR__ . "/test-folder";
@mkdir($dir);
$magic_file_copy = $dir . "/magic.copy";
$magic_file_copy2 = $magic_file_copy . "2";
copy($magic_file, $magic_file_copy);
copy($magic_file, $magic_file_copy2);
$ret = finfo_open(FILEINFO_NONE, $dir);
var_dump($ret);
$ret = @finfo_open(FILEINFO_NONE, $dir);
var_dump($ret);
$ret = @finfo_open(FILEINFO_NONE, $dir. "/non-exits-dir");
var_dump($ret);
// write some test files to test folder
file_put_contents($dir . "/test1.txt", "string\n> Core\n> Me");
file_put_contents($dir . "/test2.txt", "a\nb\n");
@mkdir($dir . "/test-inner-folder");
finfo_open(FILEINFO_NONE, $dir);
echo "DONE: testing dir with files\n";
rmdir($dir . "/test-inner-folder");
unlink($dir . "/test1.txt");
unlink($dir . "/test2.txt");
unlink($magic_file_copy);
unlink($magic_file_copy2);
rmdir($dir);
?>
===DONE===
--EXPECTF--
bool(false)
resource(%d) of type (file_info)
resource(%d) of type (file_info)
bool(false)
Notice: finfo_open(): Warning: offset `string' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: offset ` Core' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: type `Core' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: offset `a' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: type `a' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: offset `b' invalid in %sbug61964.php on line %d
Notice: finfo_open(): Warning: type `b' invalid in %sbug61964.php on line %d
Warning: finfo_open(): Failed to load magic database at '%stest-folder'. in %sbug61964.php on line %d
DONE: testing dir with files
===DONE===

View File

@ -1,9 +1,12 @@
--TEST--
Bug #43073 (TrueType bounding box is wrong for angle<>0)
Bug #43073 (TrueType bounding box is wrong for angle<>0) freetype < 2.4.10
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imagettftext')) die('skip imagettftext() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.10') >= 0) die('skip for freetype < 2.4.10');
?>
--FILE--
<?php

View File

@ -0,0 +1,51 @@
--TEST--
Bug #43073 (TrueType bounding box is wrong for angle<>0) freetype >= 2.4.10
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imagettftext')) die('skip imagettftext() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10');
?>
--FILE--
<?php
$cwd = dirname(__FILE__);
$font = "$cwd/Tuffy.ttf";
$delta_t = 360.0 / 16; # Make 16 steps around
$g = imagecreate(800, 800);
$bgnd = imagecolorallocate($g, 255, 255, 255);
$black = imagecolorallocate($g, 0, 0, 0);
$x = 100;
$y = 0;
$cos_t = cos(deg2rad($delta_t));
$sin_t = sin(deg2rad($delta_t));
for ($angle = 0.0; $angle < 360.0; $angle += $delta_t) {
$bbox = imagettftext($g, 24, $angle, 400+$x, 400+$y, $black, $font, 'ABCDEF');
$s = vsprintf("(%d, %d), (%d, %d), (%d, %d), (%d, %d)\n", $bbox);
echo $s;
$temp = $cos_t * $x + $sin_t * $y;
$y = $cos_t * $y - $sin_t * $x;
$x = $temp;
}
imagepng($g, "$cwd/bug43073.png");
?>
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug43073.png'); ?>
--EXPECTF--
(500, 400), (610, 400), (610, 376), (500, 376)
(492, 363), (591, 322), (580, 295), (480, 336)
(470, 331), (548, 254), (527, 233), (449, 310)
(439, 309), (483, 202), (461, 193), (416, 299)
(400, 300), (400, 183), (380, 183), (380, 300)
(362, 307), (316, 195), (291, 205), (337, 318)
(330, 329), (246, 244), (224, 265), (308, 350)
(308, 360), (202, 316), (190, 344), (296, 388)
(300, 400), (187, 400), (187, 425), (300, 425)
(306, 437), (195, 483), (206, 510), (318, 464)
(328, 469), (240, 557), (260, 578), (349, 491)
(359, 491), (312, 607), (334, 616), (382, 501)
(400, 500), (400, 618), (419, 618), (419, 500)
(436, 493), (483, 607), (507, 597), (461, 482)
(468, 471), (555, 558), (577, 538), (490, 450)
(490, 440), (600, 485), (611, 457), (502, 412)

View File

@ -1,9 +1,12 @@
--TEST--
Bug #48801 (Problem with imagettfbbox)
Bug #48801 (Problem with imagettfbbox) freetype < 2.4.10
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.10') >= 0) die('skip for freetype < 2.4.10');
?>
--FILE--
<?php

View File

@ -0,0 +1,25 @@
--TEST--
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10');
?>
--FILE--
<?php
$cwd = dirname(__FILE__);
$font = "$cwd/Tuffy.ttf";
$bbox = imageftbbox(50, 0, $font, "image");
echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n";
echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
?>
--EXPECTF--
(-1, 15)
(156, 15)
(156, -48)
(-1, -48)

61
ext/gd/tests/func.inc Normal file
View File

@ -0,0 +1,61 @@
<?php
function get_gd_version()
{
return GD_VERSION;
}
function get_php_info()
{
ob_start();
phpinfo();
$info = ob_get_contents();
ob_end_clean();
return $info;
}
function get_freetype_version()
{
$version = 0;
if (preg_match(',FreeType Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
$version = $match[1];
}
return $version;
}
function get_libjpeg_version()
{
$version = 0;
if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) {
$version = $match[1];
}
return $version;
}
function get_libpng_version()
{
$version = 0;
if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
$version = $match[1];
}
return $version;
}
function get_libxpm_version()
{
$version = 0;
if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) {
$version = $match[1];
}
return $version;
}

View File

@ -2,7 +2,7 @@
locale_get_display_script() icu >= 4.8
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0 || version_compare(INTL_ICU_VERSION, '49') >= 0) print 'skip'; ?>
--FILE--
<?php

View File

@ -98,6 +98,13 @@ Note that the MySQL client library is not bundled anymore!])
MYSQL_LIB_CHK($i)
done
if test -z "$MYSQL_LIB_DIR"; then
MYSQL_LIB_CHK(lib/x86_64-linux-gnu)
fi
if test -z "$MYSQL_LIB_DIR"; then
MYSQL_LIB_CHK(lib/i386-linux-gnu)
fi
if test -z "$MYSQL_LIB_DIR"; then
AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR.
Note that the MySQL client library is not bundled anymore!])

View File

@ -81,13 +81,17 @@ $tables = array(
array('label1', sprintf("'%s'", @date("Y-m-d H:i:s"))),
'label1' => array(
'timestamp',
'unsigned',
'zerofill',
'binary',
'not_null'),
),
);
if ($version < 560) {
$tables['label1 TIMESTAMP']['label1'][] = 'zerofill';
$tables['label1 TIMESTAMP']['label1'][] = 'unsigned';
}
foreach ($tables as $columns => $expected) {
if (!mysql_query("DROP TABLE IF EXISTS test", $link)) {
printf("[010/%s] [%d] %s\n", $columns, mysql_errno($link), mysql_error($link));

View File

@ -34,7 +34,7 @@ if ((!is_string($stat_def = mysql_stat())) || ('' === $stat_def))
printf("[003] Expecting non empty string, got %s/'%s', [%d] %s\n",
gettype($stat_def), $stat_def, mysql_errno(), mysql_error());
assert($stat === $stat_def);
assert(soundex($stat) === soundex($stat_def));
mysql_close($link);
@ -45,4 +45,4 @@ print "done!";
?>
--EXPECTF--
Warning: mysql_stat(): %d is not a valid MySQL-Link resource in %s on line %d
done!
done!

View File

@ -24,12 +24,12 @@ if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) {
die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error));
}
}
if (empty($row))
die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error));
if ($row[1] == 'NO')
if (($row[1] == 'NO') || ($row[1] == 'DISABLED'))
die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error));
$link->close();

View File

@ -29,7 +29,7 @@ if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) {
if (empty($row))
die(sprintf("skip Failed to test for MySQL SSL support, [%d] %s", $link->errno, $link->error));
if ($row[1] == 'NO')
if (($row[1] == 'NO') || ($row[1] == 'DISABLED'))
die(sprintf("skip MySQL has no SSL support, [%d] %s", $link->errno, $link->error));
$link->close();
@ -41,7 +41,7 @@ $link->close();
$flags = MYSQLI_CLIENT_SSL;
$link = mysqli_init();
mysqli_ssl_set($link, null, null, null, null, "RC4-MD5");
if (my_mysqli_real_connect($link, 'p:' . $host, $user, $passwd, $db, $port, null, $flags)) {

View File

@ -12,9 +12,9 @@ require_once('skipifconnectfailure.inc');
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
}
var_dump(mysqli_stat($link) === $link->stat);
var_dump(soundex(mysqli_stat($link)) === soundex($link->stat));
echo "done!";
?>
--EXPECT--
bool(true)
done!
done!

View File

@ -211,7 +211,7 @@ require_once('skipifconnectfailure.inc');
$mysqli->sqlstate, gettype($mysqli->sqlstate),
mysqli_sqlstate($link), gettype(mysqli_sqlstate($link)));
assert(mysqli_stat($link) === $mysqli->stat);
assert(soundex(mysqli_stat($link)) == soundex($mysqli->stat));
printf("mysqli->stat = '%s'/%s ('%s'/%s)\n",
$mysqli->stat, gettype($mysqli->stat),
mysqli_stat($link), gettype(mysqli_stat($link)));

View File

@ -84,6 +84,8 @@ mysqli_close($link);
'VARCHAR(2) NOT NULL PRIMARY KEY' => 'NOT_NULL PRI_KEY NO_DEFAULT_VALUE PART_KEY'
);
function checkFlags($reported_flags, $expected_flags, $flags) {
$found_flags = $unexpected_flags = '';
foreach ($flags as $code => $name) {
@ -104,6 +106,10 @@ mysqli_close($link);
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
if (mysqli_get_server_version($link) > 50600) {
$columns['TIMESTAMP NOT NULL'] = 'ON_UPDATE_NOW TIMESTAMP BINARY NOT_NULL';
}
foreach ($columns as $column_def => $expected_flags) {
if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
printf("[002] %s [%d] %s\n", $column_def,

View File

@ -0,0 +1,23 @@
--TEST--
Bug #63055 (Segfault in zend_gc with SF2 testsuite)
--FILE--
<?php
/* the default gc root size is 10,000 */
for ($i=0; $i<9998; $i++) {
$array = array();
$array[0] = &$array;
unset($array);
}
$matches = array("foo" => "bar"); /* this bucket will trigger the segfault */
$dummy = array("dummy"); /* used to trigger gc_collect_cycles */
$dummy[1] = &$dummy;
$matches[1] = &$matches;
$matches[2] = $dummy;
preg_match_all("/(\d)+/", "foo123456bar", $matches);
echo "okey";
?>
--EXPECTF--
okey

View File

@ -23,7 +23,7 @@ $db = MySQLPDOTest::factory();
printf("[002] Wonderful, I can change the client version!\n");
$new_info = $db->getAttribute(PDO::ATTR_SERVER_INFO);
if ($new_info !== $info)
if (soundex($new_info) != soundex($info))
printf("[003] Did we change it from '%s' to '%s'?\n", $info, $info);
// lets hope we always run this in the same second as we did run the server info request...

View File

@ -0,0 +1,17 @@
--TEST--
Bug #63240: stream_get_line() return contains delimiter string
--FILE--
<?php
$fd = fopen('php://temp', 'r+');
$delimiter = 'MM';
$str = str_repeat('.', 8191) . $delimiter . "rest";
fwrite($fd, $str);
rewind($fd);
$line = stream_get_line($fd, 9000, $delimiter);
var_dump(strlen($line));
$line = stream_get_line($fd, 9000, $delimiter);
var_dump($line);
?>
--EXPECT--
int(8191)
string(4) "rest"

View File

@ -989,9 +989,17 @@ PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *re
if (has_delim) {
/* search for delimiter, but skip buffered_len (the number of bytes
* buffered before this loop iteration), as they have already been
* searched for the delimiter */
* searched for the delimiter.
* The left part of the delimiter may still remain in the buffer,
* so subtract up to <delim_len - 1> from buffered_len, which is
* the ammount of data we skip on this search as an optimization
*/
found_delim = _php_stream_search_delim(
stream, maxlen, buffered_len, delim, delim_len TSRMLS_CC);
stream, maxlen,
buffered_len >= (delim_len - 1)
? buffered_len - (delim_len - 1)
: 0,
delim, delim_len TSRMLS_CC);
if (found_delim) {
break;
}