Compare commits

...
483 Commits
Author SHA1 Message Date
Ferenc Kovacs 7603abbc51 66550 will be part of 5.6.8 2015-04-15 20:05:57 +02:00
Ferenc Kovacs 4ae24d9250 remove the NEWS entry for the reverted feature 2015-04-15 19:48:13 +02:00
Xinchen Hui bf393c89d8 Fixed res leak 2015-04-15 19:43:40 +02:00
Dmitry Stogov f251b16fcc Fixed recently introduced memory leak 2015-04-15 19:43:27 +02:00
Stanislav Malyshev 5904e1e55e Revert "Merge branch 'PHP-5.5' into PHP-5.6"
This reverts commit aa22e80b1a, reversing
changes made to 3e7f47cb03.

Conflicts:
	ext/date/php_date.c
2015-04-15 19:35:18 +02:00
Stanislav Malyshev bef6df6a7e Fix bug #66550 (SQLite prepared statement use-after-free) 2015-04-15 19:32:57 +02:00
Anatol Belski c3771929b7 fix dir separator in test 2015-04-15 19:18:33 +02:00
Remi Collet 7dce9533e7 fix type in fix for #69085
(cherry picked from commit 085e9ddc26f37ce556b8fd787044746e726264b2)
2015-04-15 18:57:39 +02:00
Ferenc Kovacs 8c3093d660 add missing NEWS entry 2015-04-15 18:54:20 +02:00
Ferenc Kovacs 3592dce76d update NEWS 2015-04-15 18:34:17 +02:00
Ferenc Kovacs 6922659b8b update NEWS 2015-04-15 18:31:37 +02:00
Ferenc Kovacs f44cd92cd2 5.6.8 2015-04-15 18:31:12 +02:00
Stanislav Malyshev dc87efa848 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
2015-04-15 18:20:03 +02:00
Ferenc Kovacs 6787bfc37d add missing NEWS entry 2015-04-15 18:19:41 +02:00
Ferenc Kovacs bce433e422 update NEWS 2015-04-03 09:29:34 +02:00
Danack e0e19a12be Fixed bug #69281 (opcache_is_script_cached no longer works) 2015-04-03 09:27:48 +02:00
Ferenc Kovacs a6601cb692 5.6.8RC1 2015-04-01 01:41:15 +02:00
Ferenc Kovacs a5e68f72a7 5.6.9 is up next 2015-04-01 01:30:51 +02:00
Lior Kaplan 04c9271805 Add changelog entries for #68677, #68739 & #68740 2015-04-01 01:55:35 +03:00
Lior Kaplan c22543b3f3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68739 (Missing break / control flow in curl)
  Fixed bug #68740 (NULL Pointer Dereference)
  Fixed bug #68677 (Use After Free in OPcache)
2015-04-01 01:54:53 +03:00
Lior Kaplan a32c8ba719 Fixed bug #68739 (Missing break / control flow).
Fixed bug #68740 (NULL Pointer Dereference).
Fixed bug #68677 (Use After Free).
2015-04-01 01:45:34 +03:00
Xinchen Hui 1add8401a3 Fixed bug #68739 (Missing break / control flow in curl)
(cherry picked from commit 124fb22a13)
2015-04-01 01:24:26 +03:00
Xinchen Hui 059e774db0 Fixed bug #68740 (NULL Pointer Dereference)
(cherry picked from commit 124fb22a13)
2015-04-01 01:24:26 +03:00
Xinchen Hui 0a8f28b432 Fixed bug #68677 (Use After Free in OPcache)
(cherry picked from commit 777c39f404)
2015-04-01 01:24:16 +03:00
Derick Rethans 2d3868984c Merge branch 'PHP-5.5' into PHP-5.6 2015-03-31 16:35:10 +01:00
Derick Rethans ffbd380e44 Fixed bug #69336 (Issues with "last day of <monthname>"). 2015-03-31 16:35:03 +01:00
Julien Pauli 133c57198e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.5.25 now
2015-03-31 15:57:44 +02:00
Julien Pauli 97a1b34300 5.5.25 now 2015-03-31 15:51:47 +02:00
Derick Rethans 346c8f7331 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-31 11:09:23 +01:00
Derick Rethans 2c117a40a7 Export date_get_immutable_ce() so that extensions can make use of it too. 2015-03-31 11:08:56 +01:00
Lior Kaplan 0c1c7c7ecb Align entries format 2015-03-31 09:26:34 +03:00
Lior Kaplan b3d4790976 Update CVE for Bug #68976 to CVE-2015-2787 instead of reusing CVE for #68710 2015-03-31 09:24:56 +03:00
Lior Kaplan 96e33a7e98 Add CVE for bug #69207 2015-03-31 09:23:34 +03:00
Lior Kaplan e5fd3fc99d Align NEWS entries with 5.6.7 2015-03-31 09:20:29 +03:00
Lior Kaplan 90329a32dc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Align entries format
  Update CVE for Bug #68976 to CVE-2015-2787 instead of reusing CVE for #68710
  Add CVE for bug #69207
2015-03-31 09:17:13 +03:00
Lior Kaplan 1bc77559f3 Align entries format 2015-03-31 09:14:06 +03:00
Lior Kaplan 8654fdd884 Update CVE for Bug #68976 to CVE-2015-2787 instead of reusing CVE for #68710 2015-03-31 09:12:05 +03:00
Lior Kaplan 639f92275a Add CVE for bug #69207 2015-03-31 09:11:21 +03:00
Michael Wallner b7389f0f07 BFN 2015-03-30 16:27:08 +02:00
Michael Wallner a4490bb0a2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #64931
2015-03-30 16:25:47 +02:00
Michael Wallner 6480725007 Fixed bug #64931
phar_add_file is too restrive on filename

Check for any of '/', '\\', '\0' after ".phar".
2015-03-30 16:24:19 +02:00
Michael Wallner a24aefaac2 BFN 2015-03-30 15:41:36 +02:00
Michael Wallner 3c22449649 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed Bug #65467
2015-03-30 15:41:03 +02:00
Michael Wallner 6de25c155e Fixed Bug #65467
Call to undefined method cli_arg_typ_string

Use cli_arg_typ_filecontent instead.
2015-03-30 15:39:30 +02:00
Michael Wallner 64d9c98fa9 BFN 2015-03-30 14:43:02 +02:00
Michael Wallner 90a8b59e9c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix bug #67761
2015-03-30 14:42:37 +02:00
Michael Wallner 8f7e378b9f fix bug #67761
Phar::mapPhar fails for Phars inside a path containing ".tar".

Strengthen the silly .tar file extension check.
2015-03-30 14:41:30 +02:00
Michael Wallner 3a660bf3a5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug 64343

; Lesson learned: do not rebase on a merge commit
2015-03-30 13:48:57 +02:00
Michael Wallner ef52e44053 Fixed bug 64343
PharData::extractTo fails for tarball created by BSD tar

Phar did not know about PAX style global/file headers.
Skip them, to be able to read the contents of those archives.
2015-03-30 13:20:09 +02:00
Michael Wallner f4264ebc64 Fixed bug 64343
PharData::extractTo fails for tarball created by BSD tar

Phar did not know about PAX style global/file headers.
Skip them, to be able to read the contents of those archives.
2015-03-30 13:11:06 +02:00
Leigh a04ab4b54b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add RAND_egd check for compiling against LibreSSL
2015-03-27 13:26:48 +01:00
Leigh 1b2d58a364 Add RAND_egd check for compiling against LibreSSL 2015-03-27 13:24:36 +01:00
Lior Kaplan ebce0d5d5a Add CVE for bug #68901 2015-03-25 19:32:25 +02:00
Lior Kaplan 67c5ad6b6a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add CVE for bug #68901
2015-03-25 19:31:05 +02:00
Lior Kaplan bc0e5051e3 Add CVE for bug #68901 2015-03-25 19:26:40 +02:00
Xinchen Hui d380d1cb1b Fixed Bug #69297 (function_exists strange behavior with OPCache on disabled function)
is_callable returns true for disable_functions, but function_exists
return false for it.
2015-03-25 23:34:02 +08:00
Anatol Belski 7461c52248 updated NEWS 2015-03-25 13:14:42 +01:00
Anatol Belski c9550e81da Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #69287 upgrade bundled sqlite to 3.8.8.3
  fix dir separator in test
2015-03-25 13:13:42 +01:00
Anatol Belski 1b41dcf9c5 Fixed bug #69287 upgrade bundled sqlite to 3.8.8.3 2015-03-25 13:13:03 +01:00
Anatol Belski 8f9cb39cad fix dir separator in test 2015-03-25 13:11:27 +01:00
Remi Collet 3924548bcb Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  revert a4157423934edf7b8fdbcee163cced9bfd5748a, fix build odbc as shared
2015-03-25 10:33:31 +01:00
Remi Collet 1174b399ad revert a4157423934edf7b8fdbcee163cced9bfd5748a, fix build odbc as shared 2015-03-25 10:33:08 +01:00
Xinchen Hui eb98366642 Fixed typo 2015-03-25 13:54:42 +08:00
Xinchen Hui 3ab1513ac9 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-25 13:54:30 +08:00
Xinchen Hui 23520d7957 Fixed typo 2015-03-25 13:54:12 +08:00
Xinchen Hui 3eb893396a Update NEWS 2015-03-25 12:10:25 +08:00
Xinchen Hui 86bbacfd53 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-25 12:09:35 +08:00
Xinchen Hui 0e1024f25a UPdate NEWS 2015-03-25 12:09:21 +08:00
Xinchen Hui 76c1ec5e96 Bug #69293 NEW segfault when using SoapClient::__setSoapHeader (bisected, regression)
This was a typo introduced in c8eaca013a
2015-03-25 12:07:25 +08:00
Anatol Belski c2ec4f90d2 updated libs versions 2015-03-23 08:38:58 +01:00
Anatol Belski 8fe9715d05 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libs versions
2015-03-23 08:38:25 +01:00
Anatol Belski a52385fc02 updated libs versions 2015-03-23 08:35:36 +01:00
Stanislav Malyshev 3342a248a2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed #68021 - get_browser() browser_name_regex
2015-03-22 22:13:08 -07:00
Tjerk Meesters 5b5742c016 Fixed #68021 - get_browser() browser_name_regex
Replaced expression delimiter with tilde (~) and escape where necessary.
2015-03-22 22:12:26 -07:00
Stanislav Malyshev a1bca171d2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Print checking message for all ODBC drivers
  Change default option of ODBC drivers to no to enable bulding standalone ODBC

Conflicts:
	ext/odbc/config.m4
2015-03-22 22:04:41 -07:00
Lior Kaplan 6f5ed34d20 Print checking message for all ODBC drivers
This makes the output more readble in case no ODBC driver was selected
2015-03-22 22:03:38 -07:00
Lior Kaplan 7a41574239 Change default option of ODBC drivers to no to enable bulding standalone ODBC 2015-03-22 22:03:29 -07:00
Stanislav Malyshev 57f835e148 oops, forgot TSRMLS_CC 2015-03-22 21:55:34 -07:00
lesniewskister c12e031530 Reduce downstream patches
As per http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/php/5.6/patches/patch-ext_gd_libgd_gdcache_h?rev=1.1&content-type=text/x-cvsweb-markup
2015-03-22 21:33:45 -07:00
Stanislav Malyshev aa22e80b1a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Adding a new `createFromImmutable` method to the `DateTime` class to mirror the current `DateTime::createFromMutable()`
2015-03-22 21:03:46 -07:00
Trevor Suarez c2e22556ba Adding a new createFromImmutable method to the DateTime class to mirror the current DateTime::createFromMutable() 2015-03-22 20:54:25 -07:00
Juan Basso 3e7f47cb03 Renamed test case to match with reported bug 2015-03-22 20:34:59 -07:00
Juan Basso 4076a4d2a9 Fixed serialization of non string values on __sleep
Returning just N; (null) on the __sleep makes the number of fields/values be incomplete and corrupting the generated value from serialize, making impossible to unserialize it.

Conflicts:
	ext/standard/var.c
2015-03-22 20:31:40 -07:00
Stanislav Malyshev c6384a7908 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2
2015-03-22 18:54:48 -07:00
Masaki Kagaya 1badfd8171 add CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 2015-03-22 18:52:42 -07:00
Stanislav Malyshev fce9a856e7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bacport fix bug #68741 - Null pointer dereference
  Check that the type is correct
2015-03-22 18:32:16 -07:00
Stanislav Malyshev 723ffe2e89 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Bacport fix bug #68741 - Null pointer dereference
  Check that the type is correct
2015-03-22 18:30:56 -07:00
Stanislav Malyshev 968fbc6acf Bacport fix bug #68741 - Null pointer dereference 2015-03-22 18:30:05 -07:00
Stanislav Malyshev fb83c76dee Check that the type is correct 2015-03-22 18:17:47 -07:00
Stanislav Malyshev 40037f1474 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix #68760: Fix freeing null segfault. Added test for behaviour.

Conflicts:
	ext/sqlite3/tests/bug68760.phpt
2015-03-22 16:46:30 -07:00
Danack 0c27a8eb61 Fix #68760: Fix freeing null segfault. Added test for behaviour. 2015-03-22 16:46:02 -07:00
Danack 1ec430d4ed Fix #68760: Fix freeing null segfault. Added test for behaviour. 2015-03-22 16:44:06 -07:00
Anatol Belski 63d7cd7d5b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  cosmetic fix to default odbcver
  Remove extraneous strlen() call
2015-03-23 00:07:43 +01:00
Anatol Belski a759c40872 cosmetic fix to default odbcver 2015-03-23 00:07:09 +01:00
Rasmus Lerdorf d33636f764 Remove extraneous strlen() call 2015-03-21 08:29:12 -07:00
Rasmus Lerdorf 7fce3607ea Remove extraneous strlen() call 2015-03-21 08:28:40 -07:00
Derick Rethans a73d0b0fb3 - Updated to version 2015.2 (2015b) 2015-03-21 14:51:11 +01:00
Derick Rethans d025f8e019 Empty merge 2015-03-21 14:51:10 +01:00
Derick Rethans b98a486606 - Updated to version 2015.2 (2015b) 2015-03-21 14:51:09 +01:00
Ferenc Kovacs b5d7bcf0db this already had an entry 2015-03-20 14:40:58 +01:00
Ferenc Kovacs 95c3a4798f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add pear to the travis build
2015-03-20 13:34:35 +01:00
Ferenc Kovacs 9ff99059b1 add pear to the travis build 2015-03-20 13:34:16 +01:00
Julien Pauli d55b42bd61 Updated NEWS 2015-03-20 10:53:33 +01:00
Julien Pauli b70ba86781 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
2015-03-20 10:45:54 +01:00
Julien Pauli ceb4cb6976 Updated NEWS 2015-03-20 10:45:36 +01:00
Stanislav Malyshev eebd7c66ee Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add CVEs
2015-03-19 23:05:49 -07:00
Stanislav Malyshev 72c19d8260 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  add CVEs
2015-03-19 23:05:34 -07:00
Stanislav Malyshev 95b9c34f02 add CVEs 2015-03-19 22:54:48 -07:00
Lior Kaplan a0927357a3 Add CVE ID for #68735 2015-03-19 18:25:01 +02:00
Lior Kaplan b20b0ffe4e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add CVE ID for #68735
2015-03-19 18:24:28 +02:00
Lior Kaplan 8f18444cd9 Add CVE ID for #68735 2015-03-19 18:23:34 +02:00
Dmitry Stogov 0c3de98368 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #69152
2015-03-19 11:48:10 +03:00
Dmitry Stogov 9bdbc7490f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #69152
2015-03-19 11:42:49 +03:00
Dmitry Stogov 51856a76f8 Fixed bug #69152 2015-03-19 11:36:01 +03:00
Lior Kaplan 56cda02e11 Add CVE to bug #69253 2015-03-19 02:44:45 +02:00
Lior Kaplan 9bbf9fedff Align entries format 2015-03-19 02:42:35 +02:00
Lior Kaplan c824de432d Add CVE assigned to 5.6.6 bugs after the release 2015-03-19 02:40:22 +02:00
Lior Kaplan df340b5d8e Add CVE to bug #69248 2015-03-19 02:37:50 +02:00
Lior Kaplan 61d11d7e10 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Align entries format
  Add CVE to bug #69248
  Add CVE assigned to 5.5.22 bugs after the release
2015-03-19 02:36:28 +02:00
Lior Kaplan 6a4399a8d9 Align entries format 2015-03-19 02:35:20 +02:00
Lior Kaplan 3eba942eb2 Add CVE to bug #69248 2015-03-19 02:30:31 +02:00
Lior Kaplan 4680f08607 Add CVE assigned to 5.5.22 bugs after the release 2015-03-19 02:29:43 +02:00
Julien Pauli c7dfd8a3a4 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
2015-03-18 11:34:56 +01:00
Julien Pauli 9744aded1a Updated NEWS 2015-03-18 11:34:45 +01:00
Julien Pauli 6262db7341 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
2015-03-18 10:55:49 +01:00
Julien Pauli 5e4dd962e2 Updated NEWS 2015-03-18 10:55:32 +01:00
Stanislav Malyshev 58efcc7dd8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.4.40 next
2015-03-17 22:39:21 -07:00
Stanislav Malyshev de0cee2f39 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  5.4.40 next

Conflicts:
	configure.in
	main/php_version.h
2015-03-17 22:39:10 -07:00
Stanislav Malyshev 4c3b73b6df 5.4.40 next 2015-03-17 22:37:16 -07:00
Stanislav Malyshev 225cb973e5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  Fix bug #69253 - ZIP Integer Overflow leads to writing past heap boundary

Conflicts:
	ext/zip/lib/zip_dirent.c
2015-03-17 22:03:24 -07:00
Stanislav Malyshev 210cfafc2b update NEWS 2015-03-17 22:00:53 -07:00
Stanislav Malyshev 53eff4a369 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #69253 - ZIP Integer Overflow leads to writing past heap boundary
2015-03-17 22:00:29 -07:00
Stanislav Malyshev ef8fc4b53d Fix bug #69253 - ZIP Integer Overflow leads to writing past heap boundary 2015-03-17 21:59:56 -07:00
Stanislav Malyshev 749f82af02 oops, no idea how this got in 2015-03-17 17:13:50 -07:00
Stanislav Malyshev 14588c2499 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
2015-03-17 17:10:14 -07:00
Stanislav Malyshev bf2f03ddb3 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #69248 - heap overflow vulnerability in regcomp.c
  add test for bug #68976
2015-03-17 17:10:05 -07:00
Stanislav Malyshev 890b3987ab Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #69248 - heap overflow vulnerability in regcomp.c
  add test for bug #68976
2015-03-17 17:09:47 -07:00
Stanislav Malyshev c83dd84ad6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #69248 - heap overflow vulnerability in regcomp.c
  add test for bug #68976
2015-03-17 17:08:13 -07:00
Stanislav Malyshev fb04dcf6db Fix bug #69248 - heap overflow vulnerability in regcomp.c
Merged from https://github.com/garyhouston/regex/commit/70bc2965604b6b8aaf260049e64c708dddf85334
2015-03-17 17:04:57 -07:00
Stanislav Malyshev 8b14d3052f add test for bug #68976 2015-03-17 17:03:46 -07:00
Stanislav Malyshev dbd1d79b68 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add NEWS
2015-03-17 13:24:45 -07:00
Stanislav Malyshev 6264f81a21 add NEWS 2015-03-17 13:24:17 -07:00
Stanislav Malyshev 33a5532b66 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68976 - Use After Free Vulnerability in unserialize()

Conflicts:
	ext/standard/var_unserializer.c
2015-03-17 13:23:51 -07:00
Stanislav Malyshev d5e523f52f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #68976 - Use After Free Vulnerability in unserialize()

Conflicts:
	ext/standard/var_unserializer.c
2015-03-17 13:22:12 -07:00
Stanislav Malyshev 646572d6d3 Fixed bug #68976 - Use After Free Vulnerability in unserialize() 2015-03-17 13:20:22 -07:00
Stanislav Malyshev 3d00867bba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update news
  Fixed bug #69134 (Per Directory Values overrides PHP_INI_SYSTEM configuration options)
2015-03-17 13:09:08 -07:00
Stanislav Malyshev 3dfccd7ba5 update news 2015-03-17 13:07:40 -07:00
Stanislav Malyshev 4a2e613730 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #69134 (Per Directory Values overrides PHP_INI_SYSTEM configuration options)
2015-03-17 13:06:17 -07:00
Stanislav Malyshev bfb669891e Fixed bug #69134 (Per Directory Values overrides PHP_INI_SYSTEM configuration options) 2015-03-17 13:05:43 -07:00
Stanislav Malyshev 3477568b4e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix tests
  Fix bug #69207 - move_uploaded_file allows nulls in path
2015-03-17 12:58:00 -07:00
Stanislav Malyshev 34418222d7 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix tests
2015-03-17 12:56:37 -07:00
Stanislav Malyshev 9ba4db5e5d fix tests 2015-03-17 12:55:35 -07:00
Stanislav Malyshev e55e40ca66 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #69207 - move_uploaded_file allows nulls in path
2015-03-17 12:48:37 -07:00
Stanislav Malyshev 1291d6bbee Fix bug #69207 - move_uploaded_file allows nulls in path 2015-03-17 12:47:58 -07:00
Anatol Belski f040b48358 updated NEWS 2015-03-17 09:21:38 +01:00
Anatol Belski a6a58dddc3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #65406 Enchant broker plugins are in the wrong place in windows
2015-03-17 09:20:54 +01:00
Anatol Belski 0f18a15e89 Fixed bug #65406 Enchant broker plugins are in the wrong place in windows 2015-03-17 09:20:16 +01:00
Julien Pauli 2a50877428 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix flaws in session module
2015-03-16 16:01:12 +01:00
Julien Pauli 4dba99c226 Fix flaws in session module 2015-03-16 16:00:46 +01:00
Anatol Belski 8f898c0706 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  backport af2b0669 into 5.5
2015-03-16 08:34:14 +01:00
Anatol Belski 293d6e629d backport af2b0669 into 5.5 2015-03-16 08:32:39 +01:00
Anatol Belski af2b066911 libxml-2.9.2 compatibility 2015-03-15 18:38:50 +01:00
Anatol Belski 2ac31872ac Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2015-03-14 18:30:32 +01:00
Anatol Belski c21c8f369d fix test 2015-03-14 18:29:59 +01:00
Nikita Popov 846c8059e6 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-14 09:18:31 +01:00
Jeff Welch 1e51c5411e Fix #69203: FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127 2015-03-14 09:17:36 +01:00
Xinchen Hui 96bb3b838c Merge branch 'PHP-5.5' into PHP-5.6 2015-03-14 11:31:53 +08:00
Xinchen Hui 5b87d52041 Fixed typo 2015-03-14 11:31:12 +08:00
Xinchen Hui 669c7104c3 Update NEWS 2015-03-14 00:53:51 +08:00
Xinchen Hui 396bc00caa Merge branch 'PHP-5.5' into PHP-5.6 2015-03-14 00:53:32 +08:00
Xinchen Hui ed59370f0a Little improvement, update NEWs, added test 2015-03-14 00:52:53 +08:00
Xinchen Hui 1b5ad03f66 Merge branch 'bug69227' of https://github.com/Vektah/php-src into PHP-5.5 2015-03-14 00:42:36 +08:00
Nikita Popov 4b930e156f Merge branch 'PHP-5.5' into PHP-5.6 2015-03-13 16:25:21 +01:00
Nikita Popov a9d73f0646 Fixed bug #69221
A generator iterator can be created from different zvals - use
the object handle to manage references instead.
2015-03-13 16:23:53 +01:00
Vektah 482500b455 Fix a leak 2015-03-13 15:54:30 +11:00
Vektah 950d3d6e9b Fix bug #69227 and #65967
This patch fixes a use (in zend_gc.c) after free (in spl_observer.c).
See https://bugs.php.net/bug.php?id=69227
2015-03-13 15:02:05 +11:00
Anatol Belski 8cc8d4830a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  create the php prefix if doesn't exist
2015-03-12 15:21:33 +01:00
Anatol Belski 6b643f0741 create the php prefix if doesn't exist 2015-03-12 15:20:53 +01:00
Daniel Lowrey c661121459 Don't block on crypto data inside stream_select() 2015-03-11 09:44:07 -06:00
Xinchen Hui d4f727d0f8 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-11 08:20:03 +08:00
Xinchen Hui 675606f1a6 Improve test script for #69212 2015-03-11 08:19:34 +08:00
Daniel Lowrey 3f6b12795c Fix bug# 69215 (Crypto servers should send client CA list) 2015-03-10 18:13:10 -06:00
Nikita Popov 49bd45a2c1 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 18:19:27 +01:00
Nikita Popov bc9f2fb8df Fixed bug #69212 2015-03-10 18:17:56 +01:00
Dmitry Stogov b52a2940af Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  We don't cache custom strems with callbacks anymore
2015-03-10 19:30:32 +03:00
Dmitry Stogov c814b3294a We don't cache custom strems with callbacks anymore 2015-03-10 19:25:30 +03:00
Xinchen Hui 25050e3b00 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 17:18:47 +08:00
Xinchen Hui f074870f4e Typo 2015-03-10 17:18:39 +08:00
Xinchen Hui b5589d3fb4 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 17:06:05 +08:00
Xinchen Hui 6f4af2da29 Fixed test 2015-03-10 17:05:47 +08:00
Xinchen Hui 0584b2df3f Update NEWS 2015-03-10 15:38:34 +08:00
Xinchen Hui abb09693ac Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 15:37:14 +08:00
Xinchen Hui 6a6c273893 Fixed bug #66609 (php crashes with __get() and ++ operator in some cases) 2015-03-10 15:36:42 +08:00
Xinchen Hui f6762192d2 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-10 10:44:07 +08:00
Xinchen Hui 22894e74c2 Fix is reverted (test fails in all branches) 2015-03-10 10:43:05 +08:00
Daniel Lowrey 69691cc8ca Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix crypto stream timeout regressions
2015-03-09 15:55:33 -06:00
Daniel Lowrey bbfd4a5e62 Fix crypto stream timeout regressions 2015-03-09 15:53:26 -06:00
Xinchen Hui 4ca14f681e Merge branch 'PHP-5.5' into PHP-5.6 2015-03-09 17:23:04 +08:00
Xinchen Hui 9af1383a3f Revert "Fix #63486"
This reverts commit f4c96ffcb5.
2015-03-09 17:22:56 +08:00
Xinchen Hui 711ee5e4e1 Update NEWs 2015-03-09 17:13:47 +08:00
Xinchen Hui b0ec8dfd0d Update news 2015-03-09 17:09:57 +08:00
Jeff Welch 66a2c528fe Fix #69202: FILTER_FLAG_STRIP_BACKTICK ignored unless other flags are used. 2015-03-09 17:08:35 +08:00
Stanislav Malyshev 0f333fa93c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  added missing parentheses
  Fix #67626
  Fix #63486

Conflicts:
	main/streams/userspace.c
2015-03-08 23:41:30 -07:00
Masaki Kagaya 934d6ed900 added missing parentheses
added test case for bug #68846
replaced tab with space
added missing parentheses again
See also: http://icu-project.org/docs/papers/gb18030.html#h7
2015-03-08 23:40:56 -07:00
Julien Pauli 7d47d9fe23 Fix #67626 2015-03-08 23:40:55 -07:00
Julien Pauli 7684d72df8 Fix #63486 2015-03-08 23:40:55 -07:00
Masaki Kagaya fa72f1ea86 added missing parentheses
added test case for bug #68846
replaced tab with space
added missing parentheses again
See also: http://icu-project.org/docs/papers/gb18030.html#h7
2015-03-08 23:39:04 -07:00
Stanislav Malyshev a8da0a9620 Merge branch 'pull-request/1104' into PHP-5.5
* pull-request/1104:
  Fix #63486
2015-03-08 23:21:53 -07:00
Stanislav Malyshev 43b426fbc4 Merge branch 'pull-request/1106' into PHP-5.5
* pull-request/1106:
  Fix #67626
2015-03-08 22:52:21 -07:00
Stanislav Malyshev dcc031470a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Regression tests for SplFileInfo class setters
2015-03-08 17:13:25 -07:00
Stanislav Malyshev a2a20d29a8 Merge branch 'pull-request/1134' into PHP-5.5
* pull-request/1134:
  Regression tests for SplFileInfo class setters
2015-03-08 17:13:02 -07:00
Stanislav Malyshev b0d1e23646 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add missing value for error_reporting directive
2015-03-08 17:05:51 -07:00
Stanislav Malyshev d7931f8f66 Merge branch 'pull-request/1130' into PHP-5.5
* pull-request/1130:
  Add missing value for error_reporting directive
2015-03-08 17:05:37 -07:00
Remi Collet 43da0d302b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix odbc build as shared
2015-03-08 07:36:35 +01:00
Remi Collet 89f86119d6 Fix odbc build as shared
Broken since a41aa46759
2015-03-08 07:34:51 +01:00
Daniel Lowrey 0928bad9ac Fixed bug #69197 (openssl_pkcs7_sign handles default value incorrectly) 2015-03-06 11:29:56 -07:00
Tjerk Meesters 469b5a9584 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68917 (parse_url fails on some partial urls)
2015-03-06 20:58:20 +08:00
Tjerk Meesters d7fb52ea20 Fixed bug #68917 (parse_url fails on some partial urls) 2015-03-06 20:51:22 +08:00
Daniel Lowrey e82878a200 Update test to run locally instead of remotely 2015-03-05 22:00:38 -07:00
Daniel Lowrey 10bc5fd4c4 Fixed bug (#69195 Inconsistent stream crypto values across versions)
PHP 5.6.0 altered the semantics of the following constants:

- STREAM_CRYPTO_METHOD_SSLv23_CLIENT
- STREAM_CRYPTO_METHOD_SSLv23_SERVER
- STREAM_CRYPTO_METHOD_TLS_CLIENT
- STREAM_CRYPTO_METHOD_TLS_SERVER

Instead of representing the SSLv23_*() handshake methods the v23
constants were changed to allow only SSLv2 or SSLv3 connections.
Likewise, the TLS methods were modified from using only the TLSv1
handshake to allowing TLS1,1.1, and 1.2. This created a situation
in which users upgrading from previous versions faced a potential
security degradation if they did not update code to use different
constants. In the interest of compatibility across PHP versions
the original semantics have been restored with the following
caveat:

**IMPORTANT**

The SSLv23 client/server methods will no longer negotiate the use
of the insecure SSLv2 or SSLv3 protocols by default. Users wishing
to allow these protocols must explicitly add them to the method
bitmask via the appropriate flags.
2015-03-05 21:09:39 -07:00
Chris Wright e7df9d710c Fix stream_select() issue with OpenSSL buffer
Ensure data from OpenSSL internal buffer has been
transfered to PHP stream buffer before a select()
emulation operation is performed

Addresses bug #65137
https://bugs.php.net/bug.php?id=65137

Conflicts:
	ext/openssl/xp_ssl.c
2015-03-05 17:18:14 -07:00
Daniel Lowrey ca24d19a89 Really fix zts this time 2015-03-05 14:09:25 -07:00
Ferenc Kovacs 33828f002d re-arrange NEWS 2015-03-05 21:07:05 +01:00
Daniel Lowrey c985ec737d Fix ZTS 2015-03-05 12:19:15 -07:00
Daniel Lowrey 010f17534f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix ZTS build
2015-03-05 12:13:33 -07:00
Daniel Lowrey e892f5382f Fix ZTS build 2015-03-05 12:12:55 -07:00
Ferenc Kovacs d4d05c8919 5.6.8 up next 2015-03-05 19:07:23 +01:00
Daniel Lowrey 5939de35a8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #67403 (Add signatureType to openssl_x509_parse)
  5.5.24 now

Conflicts:
	configure.in
	main/php_version.h
2015-03-05 10:21:32 -07:00
Daniel Lowrey 94140afa69 Fix bug #67403 (Add signatureType to openssl_x509_parse) 2015-03-05 10:09:06 -07:00
Julien Pauli 0f334a1265 5.5.24 now 2015-03-05 14:13:39 +01:00
Xinchen Hui e8e5913e5e Merge branch 'PHP-5.5' into PHP-5.6 2015-03-05 21:06:07 +08:00
Xinchen Hui 869f8bd24b Error also maybe happened here 2015-03-05 21:05:26 +08:00
Xinchen Hui 7bcdbcf98e Revert commit to zend signal by mistake 2015-03-05 19:04:43 +08:00
Xinchen Hui 56f9dc2d59 Update NEWs 2015-03-05 18:40:25 +08:00
Xinchen Hui 168be6f250 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-05 18:40:06 +08:00
Xinchen Hui f039225597 Fixed bug #69174 (leaks when unused inner class use traits precedence) 2015-03-05 18:39:50 +08:00
Rasmus Lerdorf eaa1b3e614 This test fails with multibyte on because it spews
a conversion error on the bogus file
2015-03-05 00:45:42 -08:00
Daniel Lowrey 65a9a5ca12 Fixed bug #68265 (SAN match fails with trailing DNS dot) 2015-03-04 23:55:42 -07:00
Daniel Lowrey 1de1ff75f5 Merge branch 'PHP-5.6' of https://github.com/bjori/php-src into PHP-5.6
* 'PHP-5.6' of https://github.com/bjori/php-src:
  hexadecimal is case*in*sensitive
2015-03-04 22:55:22 -07:00
Daniel Lowrey 5dcace058a Fixed bug #68879 (IP Address fields in subjectAltNames not used) 2015-03-04 22:39:25 -07:00
Daniel Lowrey ca766e0787 Fix broken test 2015-03-04 22:37:07 -07:00
Hannes Magnusson 3c2c029bfd hexadecimal is case*in*sensitive 2015-03-04 16:03:45 -08:00
Daniel Lowrey 241f3c34b8 Fixed bug #68920 (use strict peer_fingerprint input checks) 2015-03-04 12:47:46 -07:00
Xinchen Hui a29b64fc10 Fixed bug #69159 (Opcache causes problem when passing a variable variable to a function) 2015-03-04 14:48:41 +08:00
Xinchen Hui 6183408031 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-03 23:17:37 +08:00
nathan r. hruby 837eeefee9 Make killing a locker an ERROR event
At least in apache, killing a locker with SIGKILL from inside opcache prevents
the child process from emitting a corresponding log event to the access or
error logs, therefore requests are termed with no record.  This makes is
incredibly difficult to debug problems espically on systems with high counts
of cache restarts.  Since INFO level is far too noisy for production use,
switch the killing to a higher level so we can see it easier.
2015-03-03 23:16:45 +08:00
Reeze Xia 808e562f23 Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:/php-src:
2015-03-03 16:28:01 +08:00
Reeze Xia 6cb3b941df Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Improve fix for bug 67741
  Added type checks
  Added type checks
2015-03-03 16:27:35 +08:00
Reeze Xia 304fb7a3d6 Merge branch 'PHP-5.5' of git.php.net:/php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:/php-src:
  Added type checks
  Added type checks
2015-03-03 16:27:04 +08:00
Reeze Xia 860fc3947f Improve fix for bug 67741
Thanks to laruence.
2015-03-03 16:25:43 +08:00
Dmitry Stogov c433f19a6b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Added type checks
2015-03-03 10:46:55 +03:00
Dmitry Stogov b3ac352253 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Added type checks
2015-03-03 10:45:07 +03:00
Dmitry Stogov c8eaca013a Added type checks 2015-03-03 10:43:48 +03:00
Dmitry Stogov 5c03e05692 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  Update NEWS
2015-03-03 10:20:21 +03:00
Dmitry Stogov 66c883c0fd Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:php-src:
  Update NEWS
2015-03-03 10:19:54 +03:00
Dmitry Stogov 26827a0111 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Added type checks
  Fixed bug #67741 (auto_prepend_file messes up __LINE__)
  Check variable type before its usage as IS_ARRAY.
  Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
2015-03-03 09:59:32 +03:00
Dmitry Stogov 035d80523f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Added type checks

Conflicts:
	ext/soap/soap.c
2015-03-03 09:52:21 +03:00
Dmitry Stogov 0c136a2abd Added type checks 2015-03-03 09:44:46 +03:00
Reeze Xia f353162ca2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update NEWS
  Fixed bug #67741 (auto_prepend_file messes up __LINE__)
  Check variable type before its usage as IS_ARRAY.
  Fixed a bug that header value is not terminated by '\0' when accessed through getenv().

Conflicts:
	NEWS
2015-03-03 14:37:06 +08:00
Reeze Xia bb466d57ae Update NEWS 2015-03-03 14:22:03 +08:00
Reeze Xia 4e2c87edb3 Fixed bug #67741 (auto_prepend_file messes up __LINE__)
This also fixes bug #54081
2015-03-03 11:43:23 +08:00
Reeze Xia 34f09b6240 Fixed bug #67741 (auto_prepend_file messes up __LINE__)
This also fixes bug #54081
2015-03-03 11:25:30 +08:00
Jeremy Mikola dea7bc8786 Regression tests for SplFileInfo class setters
Adds tests for SplFileInfo class setters accepting either the base and child classes, and throwing an exception for unexpected classes.

Related: http://svn.php.net/viewvc?view=revision&revision=336017 and https://github.com/facebook/hhvm/pull/4917
2015-03-02 14:45:26 -05:00
Dmitry Stogov fc1f24b7a6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Check variable type before its usage as IS_ARRAY.
  Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
2015-03-02 12:30:38 +03:00
Dmitry Stogov d5248f67b5 Check variable type before its usage as IS_ARRAY. 2015-03-02 12:27:36 +03:00
Xinchen Hui 169ac35c66 Update NEWS 2015-03-01 23:17:57 +08:00
Xinchen Hui 672a396d4a Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/standard/var_unserializer.c
2015-03-01 23:17:41 +08:00
Xinchen Hui caebb76131 Fixed bug #69139 (Crash in gc_zval_possible_root on unserialize) 2015-03-01 23:16:15 +08:00
Lior Kaplan 1a35c959a9 Add missing value for error_reporting directive 2015-03-01 15:16:53 +02:00
Lior Kaplan aaaa905912 Align entries format for 5.6.7 2015-03-01 11:36:01 +02:00
Lior Kaplan 041b472d6f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Align entries format for 5.5.23
2015-03-01 11:34:11 +02:00
Lior Kaplan 55f7747bff Align entries format for 5.5.23 2015-03-01 11:32:09 +02:00
Reeze Xia 214350f4f4 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bump header year
2015-03-01 15:08:20 +08:00
Reeze Xia c98eb695b5 Bump header year 2015-03-01 15:03:21 +08:00
Reeze Xia 6ef477f947 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update NEWS
2015-02-28 16:45:44 +08:00
Reeze Xia 8b0cf0d7fa Update NEWS 2015-02-28 16:45:26 +08:00
Reeze Xia 1b240ff9e3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #69141 Missing arguments in reflection info for some builtin functions
2015-02-28 16:40:06 +08:00
Reeze Xia f824f91ac9 Fixed bug #69141 Missing arguments in reflection info for some builtin functions
This include:

- setcookie (missing "httponly")
- setrawcookie (missing "httponly")
- spl_autoload_register (missing 2 optional params)
- mktime  (missing "is_dst")
- gmmktime (missing "is_dst")
2015-02-28 16:37:14 +08:00
Nikita Popov b41b229d78 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-27 23:23:49 +01:00
Дмитрий Пацура e9c6798721 Fix ARG_INFO for levenshtein
This can work with 2 parameters (require)

refs http://php.net/manual/ru/function.levenshtein.php
refs https://github.com/phalcon/zephir/issues/753
2015-02-27 23:23:24 +01:00
Xinchen Hui 4119879a39 Update NEWS 2015-02-27 23:33:23 +08:00
Xinchen Hui 86ba1a2444 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-27 23:32:59 +08:00
Xinchen Hui 997b7e5630 Fixed bug #69085 (SoapClient's __call() type confusion through unserialize()). 2015-02-27 23:32:32 +08:00
Xinchen Hui 578903578c Merge branch 'PHP-5.5' into PHP-5.6 2015-02-27 12:03:00 +08:00
Xinchen Hui 4eb830b212 Reorder 2015-02-27 12:02:42 +08:00
Xinchen Hui 414bc8ee03 Update NEWs 2015-02-27 12:01:28 +08:00
Xinchen Hui d377cb6207 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-27 12:01:05 +08:00
Xinchen Hui ebfc49aa91 Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build) 2015-02-27 12:00:52 +08:00
Xinchen Hui 4b83d02b4b Update News 2015-02-27 11:43:41 +08:00
Xinchen Hui cfaf7c3b5f Merge branch 'PHP-5.5' into PHP-5.6 2015-02-27 11:42:57 +08:00
Xinchen Hui 3e82816ba1 Fixed bug #69125 (Array numeric string as key) 2015-02-27 11:42:36 +08:00
Xinchen Hui 2d1a3ecd27 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-27 11:11:45 +08:00
Taoguang Chen e441d71baa fix bug#68942's patch
Fix type confusion bug in unserialize() with DateTimeZone. https://bugs.php.net/bug.php?id=68942
2015-02-27 10:41:53 +08:00
George Wang 65810bf259 Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). 2015-02-25 11:24:19 -05:00
George Wang f13a88ac13 Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). 2015-02-25 11:23:36 -05:00
George Wang 8584cc010a Fixed a bug that header value is not terminated by '\0' when accessed through getenv(). 2015-02-25 10:48:19 -05:00
Xinchen Hui 9502d67a8e Merge branch 'PHP-5.5' into PHP-5.6 2015-02-25 20:49:17 +08:00
Xinchen Hui 34d397e267 better name 2015-02-25 20:49:07 +08:00
Xinchen Hui d3615b5fb1 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/opcache/tests/bug69038.phpt
2015-02-25 20:13:47 +08:00
Xinchen Hui d508ff9640 Improve fix for #69038 2015-02-25 20:07:02 +08:00
Xinchen Hui d05575afd0 Update NEWs 2015-02-25 18:22:41 +08:00
Xinchen Hui 9641bac0f5 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-25 18:22:18 +08:00
Xinchen Hui ffdc5728c8 Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage) 2015-02-25 18:21:59 +08:00
Julien Pauli caacaee681 Updated NEWS 2015-02-23 11:23:48 +01:00
Julien Pauli 5256ffd4fe Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  curl: add new proxy constants
2015-02-23 11:23:00 +01:00
Julien Pauli 1bfbb546f7 updated NEWS 2015-02-23 11:22:44 +01:00
Linus Unnebäck 63ab6d8249 curl: add new proxy constants 2015-02-23 11:19:36 +01:00
Julien Pauli ee2f749a22 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed test fails for bug68557
2015-02-23 10:35:35 +01:00
Xinchen Hui d5a1a3342b Fixed test fails for bug68557 2015-02-23 10:35:16 +01:00
Jakub Zelenka 97d809a8a5 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/json/json.c
2015-02-22 20:35:03 +00:00
Jakub Zelenka 591dbcabe5 Fix bug #64695 (JSON_NUMERIC_CHECK has issues with strings that are numbers plus the letter e) 2015-02-22 20:22:47 +00:00
Rasmus Lerdorf 7ea5b3f71c NEWS entry 2015-02-22 08:32:32 -08:00
Rasmus Lerdorf ffd2fda0f3 NEWS entry 2015-02-22 08:31:17 -08:00
Rasmus Lerdorf a9ba407ce1 Fix bug #68166
We can't always efree here
php_escape_html_entities can return an interned_empty_string
2015-02-22 08:25:56 -08:00
Rasmus Lerdorf e12b72d3f7 Fix bug #68166
We can't always efree here
php_escape_html_entities can return an interned_empty_string
2015-02-22 08:14:41 -08:00
Anatol Belski 98959f6220 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
2015-02-22 16:47:56 +01:00
Anatol Belski 871d51929b updated NEWS 2015-02-22 16:47:44 +01:00
Anatol Belski 8f6a013c97 updated NEWS 2015-02-22 16:46:39 +01:00
Anatol Belski e656932d0e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix Win32 SSPI initialization for digest authentication in cURL
2015-02-22 16:26:52 +01:00
Anatol Belski 68afd75ecd Merge branch 'pull-request/1112' into PHP-5.5 2015-02-22 16:26:02 +01:00
Grant Pannell 7988f703f8 Fix Win32 SSPI initialization for digest authentication in cURL 2015-02-22 23:34:55 +10:30
Anatol Belski 3cf2b7cc2b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  revisit fix for bug #65272

Conflicts:
	ext/standard/file.c
2015-02-21 14:14:24 +01:00
Anatol Belski 6751f8b314 revisit fix for bug #65272 2015-02-21 14:10:59 +01:00
Julien Pauli c4c3dca302 Fix #67626 2015-02-20 16:07:40 +01:00
Anatol Belski b21d0848c9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  split test for bug #68557 for windows
2015-02-20 16:02:07 +01:00
Anatol Belski 3082177bee split test for bug #68557 for windows 2015-02-20 16:01:34 +01:00
Julien Pauli 95be012dce Updated NEWS 2015-02-20 15:44:18 +01:00
Julien Pauli 46e5f0c6bb Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
2015-02-20 15:43:53 +01:00
Julien Pauli 6393556a5d Updated NEWS 2015-02-20 15:43:38 +01:00
Julien Pauli 13c3b78f1e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #68557
2015-02-20 15:38:48 +01:00
Julien Pauli c111d1cd70 fix #68557 2015-02-20 15:09:35 +01:00
Julien Pauli f4c96ffcb5 Fix #63486 2015-02-20 13:38:35 +01:00
Dmitry Stogov 90421b0d5b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed type mismatch
2015-02-20 10:32:34 +03:00
Dmitry Stogov 9fb48edf3c Fixed type mismatch 2015-02-20 10:31:24 +03:00
Ferenc Kovacs 97dd859c9c update NEWS to match the actual stuff in 5.6.6 2015-02-18 20:10:28 +01:00
Ferenc Kovacs d58e76fd69 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS to match the actual stuff in 5.5.22
2015-02-18 20:09:12 +01:00
Ferenc Kovacs 3d777c8068 update NEWS to match the actual stuff in 5.5.22 2015-02-18 20:08:46 +01:00
Ferenc Kovacs 73a9c701ad update NEWS(add missing entry for the enchant fix, and reorder the entries a bit) 2015-02-18 19:52:00 +01:00
Ferenc Kovacs 3261995092 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix typo in bug#
  add CVE
  5.4.39 next
2015-02-18 19:49:23 +01:00
Ferenc Kovacs 24be46323b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix typo in bug#
  add CVE
  5.4.39 next

Conflicts:
	configure.in
	main/php_version.h
2015-02-18 19:48:50 +01:00
Ferenc Kovacs c17a17e44b fix typo in bug# 2015-02-18 19:47:07 +01:00
Ferenc Kovacs c0a5905522 update NEWS 2015-02-18 19:39:58 +01:00
Ferenc Kovacs 920de2cbe8 fix email format 2015-02-18 19:20:13 +01:00
Ferenc Kovacs 941c1a5fa8 update NEWS 2015-02-18 16:33:32 +01:00
Ferenc Kovacs 4bae11b533 update 5.6.6 release date in NEWS 2015-02-18 16:32:57 +01:00
Ferenc Kovacs 68128efa4b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI)
2015-02-18 16:32:23 +01:00
Ferenc Kovacs 08b6fe9ef1 Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI) 2015-02-18 16:24:09 +01:00
Michael Wallner 6dfc7cbe61 BFN 2015-02-18 14:08:52 +01:00
Michael Wallner ec7ba48e67 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2015-02-18 14:06:39 +01:00
Michael Wallner 83dda66aac fix test 2015-02-18 14:06:32 +01:00
Michael Wallner 23e4af185a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2015-02-18 14:05:02 +01:00
Michael Wallner 8b6919c77c fix test 2015-02-18 14:04:53 +01:00
Michael Wallner 0d2a2b98c9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
2015-02-18 13:59:32 +01:00
Michael Wallner 225af964c0 Fixed bug #65593 (Segfault when calling ob_start from output buffering callback) 2015-02-18 13:58:31 +01:00
Julien Pauli f977a9f2be Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
2015-02-18 12:41:47 +01:00
Julien Pauli 73c2e9153a Updated NEWS 2015-02-18 12:40:38 +01:00
Remi Collet c6a26cb39d add CVE 2015-02-18 06:44:41 +01:00
Xinchen Hui 97f8c78b09 Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into PHP-5.5 2015-02-17 21:17:06 +08:00
Xinchen Hui ed1967c706 Merge branch 'PHP-5.6' of https://git.php.net/repository/php-src into PHP-5.6 2015-02-17 21:16:53 +08:00
Xinchen Hui e22759b1e5 Replace var is introduced 2015-02-17 21:16:37 +08:00
Stanislav Malyshev 0a331f49c1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix TS build
2015-02-17 07:47:27 +01:00
Stanislav Malyshev 213725057e fix TS build 2015-02-17 07:47:12 +01:00
Stanislav Malyshev 24f8a68d0a 5.4.39 next 2015-02-17 07:34:00 +01:00
Stanislav Malyshev c538a2eb12 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update news
2015-02-17 06:58:24 +01:00
Stanislav Malyshev 2e8cd42974 update news 2015-02-17 06:58:14 +01:00
Stanislav Malyshev 78389b29f9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
  Port for for bug #68552
  Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
  - BFN
2015-02-17 06:57:50 +01:00
Stanislav Malyshev cf7d8eabcc Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Port for for bug #68552
  Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
  - BFN
2015-02-17 06:53:48 +01:00
Stanislav Malyshev 29a4e710de Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone) 2015-02-17 06:53:27 +01:00
Stanislav Malyshev bdfe457a2c Port for for bug #68552 2015-02-17 06:53:02 +01:00
Stanislav Malyshev 7b18981830 Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
Conflicts:
	ext/date/php_date.c
2015-02-17 06:43:51 +01:00
Xinchen Hui dec83ea4ac Update NEWS 2015-02-17 11:36:44 +08:00
Xinchen Hui 1c0fa36c61 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-17 11:36:15 +08:00
Xinchen Hui 66d3095993 Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) 2015-02-17 11:34:57 +08:00
Felipe Pena 82d347a477 - BFN 2015-02-17 01:14:05 -02:00
Felipe Pena f6e9ed76ae Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
2015-02-17 01:08:48 -02:00
Felipe Pena 94742054a8 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support)
  - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de
  Update NEWS
2015-02-17 01:08:07 -02:00
Felipe Pena 0c01fca444 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support)
  - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de
  Update NEWS
2015-02-17 00:28:28 -02:00
Felipe Pena a331ae4630 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support)
  - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de
  Update NEWS
2015-02-17 00:28:11 -02:00
Felipe Pena 8f9ab04d93 - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support) 2015-02-17 00:23:47 -02:00
Felipe Pena abbc82f448 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  - Fix merge
  BFN
2015-02-16 13:09:52 -02:00
Felipe Pena 35a68c276d - Fix merge 2015-02-16 13:09:40 -02:00
Felipe Pena e08bef442c - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de 2015-02-16 13:07:26 -02:00
Antony Dovgal dbf7d525a5 BFN 2015-02-16 15:23:13 +03:00
Antony Dovgal 1d94cd4bfa Merge branch 'pull-request/995' into PHP-5.5
* pull-request/995:
  fix bug #68822 (request time is reset too early)
2015-02-16 15:20:39 +03:00
Antony Dovgal c4664d1731 Merge branch 'pull-request/995' into PHP-5.6
* pull-request/995:
  fix bug #68822 (request time is reset too early)
2015-02-16 15:15:11 +03:00
redfoxli 3664345aba fix bug #68822 (request time is reset too early)
this caused wrong time in the logs
2015-02-16 15:10:09 +03:00
Xinchen Hui 8309988111 Fixed bug #68912 (Segmentation fault at openssl_spki_new) 2015-02-16 14:16:52 +08:00
Xinchen Hui 423a057023 Update NEWs 2015-02-15 23:00:34 +08:00
Xinchen Hui edd16831b1 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-15 22:55:42 +08:00
Xinchen Hui a620b79040 Fixed bug #69054 (Null dereference in readline_(read|write)_history() without parameters) 2015-02-15 22:54:05 +08:00
Michael Wallner 4137956d0e fix detection of mbstate_t with clang
AC_TRY_COMPILE expexts a function body
2015-02-15 09:25:03 +01:00
Xinchen Hui 1db720cd6d Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/pgsql/pgsql.c
2015-02-14 22:18:13 +08:00
Xinchen Hui 7667f8efc6 Fixed bug #68638 (pg_update() fails to store infinite values) 2015-02-14 22:17:01 +08:00
Xinchen Hui 40a94597ae Merge branch 'PHP-5.4' of https://github.com/wfelipew/php-src into PHP-5.5 2015-02-14 22:03:53 +08:00
Yasuo Ohgaki c0dd221a3a Update NEWS 2015-02-14 05:41:04 +09:00
Yasuo Ohgaki d0be36cf5b Update NEWS 2015-02-14 05:40:51 +09:00
Yasuo Ohgaki 5b6269a253 Update NEWS 2015-02-14 05:34:57 +09:00
Yasuo Ohgaki a54300b3f6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add NULL byte protection to exec, system and passthru
2015-02-14 05:27:44 +09:00
Yasuo Ohgaki 3ea76a768c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Add NULL byte protection to exec, system and passthru
2015-02-14 05:26:54 +09:00
Yasuo Ohgaki a8722f5330 Add NULL byte protection to exec, system and passthru 2015-02-14 05:25:04 +09:00
Anatol Belski b3d28d14d6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix condition
2015-02-13 13:40:10 +01:00
Anatol Belski 5ff77b005b fix condition 2015-02-13 13:39:46 +01:00
Xinchen Hui adc4265792 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-13 13:12:44 +08:00
Xinchen Hui 3a71fa36a2 Micro opt 2015-02-13 13:09:56 +08:00
Xinchen Hui 371c016986 Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into PHP-5.5 2015-02-13 12:54:04 +08:00
Xinchen Hui 68ab716f18 Fixed #69015 (php-cgi's getopt does not see $argv)
No test script is added because of complicated
2015-02-13 12:53:34 +08:00
William Felipe Welter 0421404b73 Fixed bug #68638 pg_update() fails to store infinite values
Fix indent
2015-02-12 23:39:54 -02:00
Anatol Belski d05070c98d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  backport gd config.w32 to support freetype 2.5
2015-02-12 20:29:24 +01:00
Anatol Belski b5aca81de1 backport gd config.w32 to support freetype 2.5 2015-02-12 20:27:48 +01:00
Xinchen Hui 3ae88e023c Merge branch 'PHP-5.5' into PHP-5.6 2015-02-12 11:28:30 +08:00
Xinchen Hui c2062ca470 Added test for #69017 2015-02-12 11:28:16 +08:00
Xinchen Hui 7062465be0 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-12 10:59:59 +08:00
Xinchen Hui f2940b7120 Fixed bug #69017 (Fail to push to the empty array with the constant value defined in class scope) 2015-02-12 10:59:28 +08:00
Lior Kaplan c741faf4bb Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #55508 was fixed in 5.5.19 with 15ba757a, not in 5.5.18
  Add missing NEWS entry for revert of bug #41631
  Add missing NEWS entry for bug #68027
  Align format for bug #68799
  Bug #68361 was fixed in 5.5.20 using 327d4f9a, not in 5.5.19
  Bug #55618 was fixed in 5.5.21 using eaf107c0
  Add security bugs fixed in 5.5.18
  Add CVE ID to bug #68676
  Align email format for recent NEWS entries
2015-02-11 22:30:48 +02:00
Lior Kaplan 701a5f9de9 Add missing NEWS entry for revert of bug #41631 2015-02-11 14:02:55 +02:00
Lior Kaplan b17e2b8214 Add CVE ID to bug #68676 2015-02-11 14:01:55 +02:00
Lior Kaplan 27d6cf4860 Align email format for recent NEWS entries 2015-02-11 14:01:16 +02:00
Lior Kaplan e6d8bad618 Bug #55508 was fixed in 5.5.19 with 15ba757a, not in 5.5.18
See https://github.com/php/php-src/pull/631#issuecomment-61969527
2015-02-11 13:20:44 +02:00
Lior Kaplan 1ebf6fba42 Add missing NEWS entry for revert of bug #41631 2015-02-11 13:15:18 +02:00
Lior Kaplan b582aa9a44 Add missing NEWS entry for bug #68027 2015-02-11 13:13:03 +02:00
Lior Kaplan bb16a6b2c2 Align format for bug #68799 2015-02-11 13:11:55 +02:00
Lior Kaplan f0b329df50 Bug #68361 was fixed in 5.5.20 using 327d4f9a, not in 5.5.19 2015-02-11 13:08:19 +02:00
Lior Kaplan 7bcf62a05b Bug #55618 was fixed in 5.5.21 using eaf107c0 2015-02-11 13:04:32 +02:00
Lior Kaplan 0d68d0a69b Add security bugs fixed in 5.5.18 2015-02-11 12:02:39 +02:00
Lior Kaplan e06da17931 Add CVE ID to bug #68676 2015-02-11 12:00:19 +02:00
Lior Kaplan e7c7788e20 Align email format for recent NEWS entries 2015-02-11 11:05:02 +02:00
Anatol Belski 4d8db154ad Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix dir separator in test
2015-02-10 16:59:22 +01:00
Anatol Belski bc3e88b9af fix dir separator in test 2015-02-10 16:58:59 +01:00
Ferenc Kovacs 5e1bb07701 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  oops, forgot sudo for make install
2015-02-10 11:18:34 +01:00
Ferenc Kovacs bf9fb65001 oops, forgot sudo for make install 2015-02-10 11:18:19 +01:00
Ferenc Kovacs ac54df17df Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add make install

Conflicts:
	travis/compile.sh
2015-02-10 10:36:25 +01:00
Ferenc Kovacs a8d001aedf add make install 2015-02-10 10:34:52 +01:00
William Felipe Welter 60d5cdf137 Fixed bug #68638 pg_update() fails to store infinite values
Check if value is "infinity" with strcasestr() to add quotes
2015-02-09 20:35:18 -02:00
Daniel Lowrey fb2314798e Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/openssl/xp_ssl.c
2015-02-09 11:44:09 -05:00
Daniel Lowrey f2b12424c0 NEWS 2015-02-09 11:42:40 -05:00
Daniel Lowrey 1eef4f2a0c Miscellaneous cleanup 2015-02-09 11:42:17 -05:00
Daniel Lowrey a8cb1d2b85 Merge branch 'PHP-5.5' of github.com:bbroerman30/php-src into PHP-5.5 2015-02-09 11:40:04 -05:00
Xinchen Hui 3d1ec33f96 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-09 11:32:32 +08:00
Xinchen Hui d078c59ed9 Merge branch 'improve-bug67436' of https://github.com/reeze/php-src into PHP-5.5 2015-02-09 11:31:59 +08:00
Bob Weinand fc444fbc70 Shut up, my lovely compiler; I do not like your warnings
Conflicts:
	Zend/zend_object_handlers.c
2015-02-09 11:23:35 +08:00
Anatol Belski 979020fcad moved the part of the test into an appropriate place 2015-02-08 14:10:52 +01:00
Anatol Belski ffdc2c4123 Merge branch 'pull-request/1060' into PHP-5.6 2015-02-08 12:33:15 +01:00
manuel cc13d8696f Fix another invalid free of CG(interned_empty_string)
Fixes #68214
2015-02-07 19:17:31 +01:00
manuel 3550cc5fd9 add tests for #68996 2015-02-07 18:52:26 +01:00
George Wang c90cd09331 Fixed #68790 (Missing return) 2015-02-07 12:19:53 -05:00
George Wang c892127f76 Fixed #68790 (Missing return) 2015-02-07 12:18:42 -05:00
George Wang 5e3f0f5671 Fixed #68790 (Missing return) 2015-02-07 12:16:54 -05:00
Reeze Xia 4d034b1a1e Improve tests for bug 67436
I always use a.php or b.php for local testing,
this diff makes the test more stable
2015-02-07 14:11:09 +08:00
William Felipe Welter bb3a81c4b4 Fixed bug #68638 pg_update() fails to store infinite values.
Add quotes only if "infinity" values are received.
2015-02-07 01:26:12 -02:00
Anatol Belski 464667153d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix setting default ODBCVER value in config.w32
2015-02-06 19:59:55 +01:00
Anatol Belski 9bf95d8291 fix setting default ODBCVER value in config.w32 2015-02-06 19:59:14 +01:00
Anatol Belski e6d16c0956 updated NEWS 2015-02-06 19:39:32 +01:00
Anatol Belski 4266f5b1c4 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
2015-02-06 19:39:10 +01:00
Anatol Belski f4319a4f73 updated NEWS 2015-02-06 19:37:01 +01:00
Anatol Belski e46e208819 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68964 Allowed memory size exhausted with odbc_exec
2015-02-06 19:05:13 +01:00
Anatol Belski a41aa46759 Fixed bug #68964 Allowed memory size exhausted with odbc_exec
This is done in two steps:

- the ODBCVER has to be rased to 0x0300 which corresponds to Sql
  Server 9, otherwise the client will not recognize several SQL
  datatypes

- additionally the config scripts was tweaked so then ODBCVER
  can be overridden, that still allows enabling compatibility
  with lower versions

Bug #67437 might be fixed by this as well.
2015-02-06 19:00:27 +01:00
manuel 13fc7f20a4 Invalid free of CG(interned_empty_string)
On failure php_escape_html_entities returns STR_EMPTY_ALLOC which is an
alias of CG(interned_empty_string) if interned strings are enabled.
Make sure we don't free this.
2015-02-06 16:53:01 +01:00
Anatol Belski 63761ab91e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Removed erroneous condition
2015-02-06 09:42:41 +01:00
Anatol Belski 9ef0c39b2b Removed erroneous condition
This condition is always false. Furthermore headers_list() is
documented to always return an array.
2015-02-06 09:41:02 +01:00
Stanislav Malyshev af23980de7 turn off online tests, they fail too often on CI 2015-02-05 22:05:36 -08:00
Stanislav Malyshev 57ba83d4e0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix tests
2015-02-05 21:56:26 -08:00
Stanislav Malyshev 928fdbea08 fix tests 2015-02-05 21:54:47 -08:00
Stanislav Malyshev a1c28567c6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update header handling to RFC 7230
2015-02-05 20:10:09 -08:00
Stanislav Malyshev 067340bbc8 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Update header handling to RFC 7230
2015-02-05 20:09:13 -08:00
Stanislav Malyshev f001c63073 Update header handling to RFC 7230 2015-02-05 20:08:12 -08:00
William Felipe Welter b64f149176 Test case Bug #68638 pg_update() fails to store infinite values 2015-02-05 13:19:52 -02:00
Stanislav Malyshev 2c386b55f2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test to not hit php.net
2015-02-05 00:41:55 -08:00
Stanislav Malyshev d33f4c6eb8 fix test to not hit php.net 2015-02-05 00:41:51 -08:00
Stanislav Malyshev 10b15f0f8b Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  Conflicts: 	main/streams/memory.c
2015-02-05 00:41:35 -08:00
Xinchen Hui ae90010891 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	main/streams/memory.c
2015-02-05 16:33:20 +08:00
Nayana Hettiarachchi 5446377c6b Conflicts:
main/streams/memory.c
2015-02-05 16:32:30 +08:00
Stanislav Malyshev ee864f3301 fix test to not hit php.net 2015-02-05 00:11:44 -08:00
Julien Pauli a79f332333 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
2015-02-04 17:45:38 +01:00
Julien Pauli 959cecf046 Updated NEWS 2015-02-04 17:43:36 +01:00
Julien Pauli 583af4979b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Revert "Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat)"
2015-02-04 17:39:34 +01:00
Julien Pauli f51b73c833 Revert "Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat)"
This reverts commit 8e19705a93.
2015-02-04 17:39:16 +01:00
Julien Pauli 421d309908 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.5.23 now

Conflicts:
	configure.in
	main/php_version.h
2015-02-04 17:32:46 +01:00
Julien Pauli e6ea244004 5.6.7 now 2015-02-04 16:37:49 +01:00
Julien Pauli b86529f751 5.5.23 now 2015-02-04 16:35:32 +01:00
Brad Broerman dddbe0fc33 Update xp_ssl.c
Added TSRMLS_CC to php_openssl_sockop_io calls.
2015-02-04 10:13:36 -05:00
William Felipe Welter cb3833a3be Fixed bug #68638 pg_update() fails to store infinite values.
Regex to check float values changed to accept "infinity" values
and ignore case. Quotes are added to prevent syntax error on
PostgreSQL.
2015-02-03 22:47:05 -02:00
Brad Broerman 1482ed2d56 reneg and should_close are not yet members of sslsock. Removing... 2015-01-28 22:36:41 -05:00
Brad Broerman fd4641696c Updated with SSL fixes (backported from trunk) 2015-01-28 00:04:20 -05:00
201 changed files with 7812 additions and 3343 deletions

No files matched your search

+1 -1
View File
@@ -39,5 +39,5 @@ before_script:
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg
+215 -21
View File
@@ -1,21 +1,208 @@
PHP NEWS
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Feb 2015, PHP 5.6.6
16 Apr 2015, PHP 5.6.8
- Core:
. Fixed bug #66609 (php crashes with __get() and ++ operator in some cases).
(Dmitry, Laruence)
. Fixed bug #68021 (get_browser() browser_name_regex returns non-utf-8
characters). (Tjerk)
. Fixed bug #68917 (parse_url fails on some partial urls). (Wei Dai)
. Fixed bug #69134 (Per Directory Values overrides PHP_INI_SYSTEM
configuration options). (Anatol Belski)
. Additional fix for bug #69152 (Type confusion vulnerability in
exception::getTraceAsString). (Stas)
. Fixed bug #69210 (serialize function return corrupted data when sleep has
non-string values). (Juan Basso)
. Fixed bug #69212 (Leaking VIA_HANDLER func when exception thrown in
__call/... arg passing). (Nikita)
. Fixed bug #69221 (Segmentation fault when using a generator in combination
with an Iterator). (Nikita)
. Fixed bug #69337 (php_stream_url_wrap_http_ex() type-confusion
vulnerability). (Stas)
. Fixed bug #69353 (Missing null byte checks for paths in various PHP
extensions). (Stas)
- Apache2handler:
. Fixed bug #69218 (potential remote code execution with apache 2.4
apache2handler). (Gerrit Venema)
- cURL:
. Implemented FR#69278 (HTTP2 support). (Masaki Kagaya)
. Fixed bug #68739 (Missing break / control flow). (Laruence)
. Fixed bug #69316 (Use-after-free in php_curl related to
CURLOPT_FILE/_INFILE/_WRITEHEADER). (Laruence)
- Date:
. Fixed bug #69336 (Issues with "last day of <monthname>"). (Derick Rethans)
- Enchant:
. Fixed bug #65406 (Enchant broker plugins are in the wrong place in windows
builds). (Anatol)
- Ereg:
. Fixed bug #68740 (NULL Pointer Dereference). (Laruence)
- Fileinfo:
. Fixed bug #68819 (Fileinfo on specific file causes spurious OOM and/or
segfault). (Anatol Belski)
- Filter:
. Fixed bug #69202: (FILTER_FLAG_STRIP_BACKTICK ignored unless other
flags are used). (Jeff Welch)
. Fixed bug #69203 (FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127). (Jeff
Welch)
- OPCache:
. Fixed bug #69297 (function_exists strange behavior with OPCache on
disabled function). (Laruence)
. Fixed bug #69281 (opcache_is_script_cached no longer works). (danack)
. Fixed bug #68677 (Use After Free). (CVE-2015-1351) (Laruence)
- OpenSSL
. Fixed bugs #68853, #65137 (Buffered crypto stream data breaks IO polling
in stream_select() contexts) (Chris Wright)
. Fixed bug #69197 (openssl_pkcs7_sign handles default value incorrectly)
(Daniel Lowrey)
. Fixed bug #69215 (Crypto servers should send client CA list)
(Daniel Lowrey)
. 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)
. Fixed bug #64931 (phar_add_file is too restrictive on filename). (Mike)
. Fixed bug #65467 (Call to undefined method cli_arg_typ_string). (Mike)
. Fixed bug #67761 (Phar::mapPhar fails for Phars inside a path containing
".tar"). (Mike)
. Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar). (Stas)
. Fixed bug #69441 (Buffer Overflow when parsing tar/zip/phar in
phar_set_inode). (Stas)
- Postgres:
. Fixed bug #68741 (Null pointer dereference). (CVE-2015-1352) (Laruence)
- SPL:
. Fixed bug #69227 (Use after free in zval_scan caused by
spl_object_storage_get_gc). (adam dot scarr at 99designs dot com)
- SOAP:
. Fixed bug #69293 (NEW segfault when using SoapClient::__setSoapHeader
(bisected, regression)). (Laruence)
- Sqlite3:
. Fixed bug #68760 (SQLITE segfaults if custom collator throws an exception).
(Dan Ackroyd)
. Fixed bug #69287 (Upgrade bundled libsqlite to 3.8.8.3). (Anatol)
. Fixed bug #66550 (SQLite prepared statement use-after-free). (Sean Heelan)
19 Mar 2015, PHP 5.6.7
- Core:
. Fixed bug #69174 (leaks when unused inner class use traits precedence).
(Laruence)
. Fixed bug #69139 (Crash in gc_zval_possible_root on unserialize).
(Laruence)
. Fixed bug #69121 (Segfault in get_current_user when script owner is not
in passwd with ZTS build). (dan at syneto dot net)
. Fixed bug #65593 (Segfault when calling ob_start from output buffering
callback). (Mike)
. Fixed bug #68986 (pointer returned by php_stream_fopen_temporary_file
not validated in memory.c). (nayana at ddproperty dot com)
. Fixed bug #68166 (Exception with invalid character causes segv). (Rasmus)
. Fixed bug #69141 (Missing arguments in reflection info for some builtin
functions). (kostyantyn dot lysyy at oracle dot com)
. Fixed bug #68976 (Use After Free Vulnerability in unserialize()).
(CVE-2015-2787) (Stas)
. Fixed bug #69134 (Per Directory Values overrides PHP_INI_SYSTEM
configuration options). (Anatol Belski)
. Fixed bug #69207 (move_uploaded_file allows nulls in path). (CVE-2015-2348)
(Stas)
- CGI:
. Fixed bug #69015 (php-cgi's getopt does not see $argv). (Laruence)
- CLI:
. Fixed bug #67741 (auto_prepend_file messes up __LINE__). (Reeze Xia)
- cURL:
. Fixed bug #69088 (PHP_MINIT_FUNCTION does not fully initialize cURL on
Win32). (Grant Pannell)
. Add CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5_HOSTNAME constants if supported
by libcurl. (Linus Unneback)
- Ereg:
. Fixed bug #69248 (heap overflow vulnerability in regcomp.c). (CVE-2015-2305)
(Stas)
- FPM:
. Fixed bug #68822 (request time is reset too early). (honghu069 at 163 dot com)
- ODBC:
. Fixed bug #68964 (Allowed memory size exhausted with odbc_exec). (Anatol)
- Opcache:
. Fixed bug #69159 (Opcache causes problem when passing a variable variable
to a function). (Dmitry, Laruence)
. Fixed bug #69125 (Array numeric string as key). (Laruence)
. Fixed bug #69038 (switch(SOMECONSTANT) misbehaves). (Laruence)
- OpenSSL:
. Fixed bug #68912 (Segmentation fault at openssl_spki_new). (Laruence)
. Fixed bug #61285, #68329, #68046, #41631 (encrypted streams don't observe
socket timeouts). (Brad Broerman)
. Fixed bug #68920 (use strict peer_fingerprint input checks)
(Daniel Lowrey)
. Fixed bug #68879 (IP Address fields in subjectAltNames not used)
(Daniel Lowrey)
. Fixed bug #68265 (SAN match fails with trailing DNS dot) (Daniel Lowrey)
. Fixed bug #67403 (Add signatureType to openssl_x509_parse) (Daniel Lowrey)
. Fixed bug (#69195 Inconsistent stream crypto values across versions)
(Daniel Lowrey)
- pgsql:
. Fixed bug #68638 (pg_update() fails to store infinite values).
(william dot welter at 4linux dot com dot br, Laruence)
- Readline:
. Fixed bug #69054 (Null dereference in readline_(read|write)_history() without
parameters). (Laruence)
- SOAP:
. Fixed bug #69085 (SoapClient's __call() type confusion through
unserialize()). (andrea dot palazzo at truel dot it, Laruence)
- SPL:
. Fixed bug #69108 ("Segmentation fault" when (de)serializing
SplObjectStorage). (Laruence)
. Fixed bug #68557 (RecursiveDirectoryIterator::seek(0) broken after
calling getChildren()). (Julien)
- ZIP:
. Fixed bug #69253 (ZIP Integer Overflow leads to writing past heap
boundary). (CVE-2015-2331) (Stas)
19 Feb 2015, PHP 5.6.6
- Core:
. Removed support for multi-line headers, as the are deprecated by RFC 7230.
(Stas)
. Fixed bug #67068 (getClosure returns somethings that's not a closure).
(Danack at basereality dot com)
. Fixed bug #68942 (Use after free vulnerability in unserialize() with
DateTimeZone). (CVE-2015-0273) (Stas)
. Fixed bug #68925 (Mitigation for CVE-2015-0235 – GHOST: glibc gethostbyname
buffer overflow). (Stas)
. Fixed Bug #67988 (htmlspecialchars() does not respect default_charset
specified by ini_set) (Yasuo)
. Added NULL byte protection to exec, system and passthru. (Yasuo)
- Dba:
. Fixed bug #68711 (useless comparisons). (bugreports at internot dot info)
- JSON:
. Fixed bug #50224 (json_encode() does not always encode a float as a float)
by adding JSON_PRESERVE_ZERO_FRACTION. (Juan Basso)
- Enchant:
. Fixed bug #68552 (heap buffer overflow in enchant_broker_request_dict()).
(CVE-2014-9705) (Antony)
- Fileinfo:
. Fixed bug #68827 (Double free with disabled ZMM). (Joshua Rogers)
@@ -30,23 +217,30 @@
(redfoxli069 at gmail dot com, Laruence)
- JSON:
. Fixed bug #68938 (json_decode() decodes empty string without error).
(jeremy at bat-country dot us)
. Fixed bug #50224 (json_encode() does not always encode a float as a float)
by adding JSON_PRESERVE_ZERO_FRACTION. (Juan Basso)
- LIBXML:
. Fixed bug #64938 (libxml_disable_entity_loader setting is shared
between threads). (Martin Jansen)
- Mysqli:
. Fixed bug #68114 (linker error on some OS X machines with fixed
width decimal support) (Keyur Govande)
. Fixed bug #68657 (Reading 4 byte floats with Mysqli and libmysqlclient
has rounding errors) (Keyur Govande)
- Opcache:
. Fixed bug with try blocks being removed when extended_info opcode
generation is turned on. (Laruence)
- PDO_mysql:
. Fixed bug #68750 (PDOMysql with mysqlnd does not allow the usage of
named pipes). (steffenb198@aol.com)
named pipes). (steffenb198 at aol dot com)
- Phar:
. Fixed bug #68901 (use after free). (bugreports at internot dot info)
. Fixed bug #68901 (use after free). (CVE-2015-2301)
(bugreports at internot dot info)
- Pgsql:
. Fixed Bug #65199 (pg_copy_from() modifies input array variable) (Yasuo)
@@ -63,12 +257,8 @@
- Standard:
. Fixed bug #65272 (flock() out parameter not set correctly in windows).
(Daniel Lowrey)
- Mysqli:
. Fixed bug #68114 (linker error on some OS X machines with fixed
width decimal support) (Keyur Govande)
. Fixed bug #68657 (Reading 4 byte floats with Mysqli and libmysqlclient
has rounding errors) (Keyur Govande)
. Fixed bug #69033 (Request may get env. variables from previous requests
if PHP works as FastCGI). (Anatol)
- Streams:
. Fixed bug which caused call after final close on streams filter. (Bob)
@@ -90,7 +280,7 @@
. Fixed bug #68583 (Crash in timeout thread). (Anatol)
. Fixed bug #65576 (Constructor from trait conflicts with inherited
constructor). (dunglas at gmail dot com)
. Fixed bug #68676 (Explicit Double Free). (Kalle)
. Fixed bug #68676 (Explicit Double Free). (CVE-2014-9425) (Kalle)
. Fixed bug #68710 (Use After Free Vulnerability in PHP's unserialize()).
(CVE-2015-0231) (Stefan Esser)
@@ -110,7 +300,7 @@
interval). (Marc Bennewitz)
- EXIF:
. Fixed bug #68799: Free called on unitialized pointer. (CVE-2015-0232)
. Fixed bug #68799: Free called on uninitialized pointer. (CVE-2015-0232)
(Stas)
- Fileinfo:
@@ -120,7 +310,7 @@
(Joshua Rogers, Anatol Belski)
. Removed readelf.c and related code from libmagic sources
(Remi, Anatol)
. Fixed bug #68735 (fileinfo out-of-bounds memory access).
. Fixed bug #68735 (fileinfo out-of-bounds memory access). (CVE-2014-9652)
(Anatol)
- FPM:
@@ -128,7 +318,8 @@
. Fixed bug #68751 (listen.allowed_clients is broken). (Remi)
- GD:
. Fixed bug #68601 (buffer read overflow in gd_gif_in.c). (Jan Bee, Remi)
. Fixed bug #68601 (buffer read overflow in gd_gif_in.c). (CVE-2014-9709)
(Jan Bee, Remi)
. Fixed request #68656 (Report gd library version). (Remi)
- mbstring:
@@ -301,6 +492,9 @@
(Matteo, Alain Laporte)
. Fixed bug #66584 (Segmentation fault on statement deallocation) (Matteo)
- OpenSSL:
. Revert regression introduced by fix of bug #41631
- Reflection:
. Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi)
@@ -567,7 +761,7 @@
. Fixed bug #67606 (revised fix 67541, broke mod_fastcgi BC). (David Zuelke)
. Fixed bug #67530 (error_log=syslog ignored). (Remi)
. Fixed bug #67635 (php links to systemd libraries without using pkg-config).
(pacho@gentoo.org, Remi)
(pacho at gentoo dot org, Remi)
. Fixed bug #67531 (syslog cannot be set in pool configuration). (Remi)
. Fixed bug #67541 (Fix Apache 2.4.10+ SetHandler proxy:fcgi://
incompatibilities). (David Zuelke)
@@ -969,7 +1163,7 @@
- FPM:
. Fixed bug #67635 (php links to systemd libraries without using pkg-config).
(pacho@gentoo.org, Remi)
(pacho at gentoo dot org, Remi)
- GD:
. Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference).
+3
View File
@@ -394,6 +394,9 @@ PHP 5.6 UPGRADE NOTES
10. New Global Constants
========================================
- CURL:
CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 (>= 5.6.8)
- LDAP:
LDAP_ESCAPE_FILTER int(1)
LDAP_ESCAPE_DN int(2)
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #66609 (php crashes with __get() and ++ operator in some cases)
--FILE--
<?php
$bar = new Bar;
$foo = new Foo;
class Bar {
public function __get($x) {
global $foo;
return $foo->foo;
}
}
class Foo {
public function __get($x) {
global $bar;
return $bar->bar;
}
}
$foo->blah += 1; //crash
++$foo->blah; //crash
$foo->blah++; //crash
$foo->blah--; //crash
--$foo->blah; //crash
echo "okey";
?>
--EXPECTF--
Notice: Undefined property: Bar::$bar in %sbug66609.php on line %d
okey
+2 -2
View File
@@ -2,14 +2,14 @@
bug67436: Autoloader isn't called if user defined error handler is present
--INI--
error_reporting=
error_reporting=-1
--FILE--
<?php
spl_autoload_register(function($classname) {
if (in_array($classname, array('a','b','c'))) {
require_once ($classname . '.php');
require_once __DIR__ . "/{$classname}.php";
}
});
+1 -1
View File
@@ -9,7 +9,7 @@ error_reporting=-1
spl_autoload_register(function($classname) {
if (in_array($classname, array('a','b','c'))) {
require_once ($classname . '.php');
require_once __DIR__ . "/{$classname}.php";
}
});
+42
View File
@@ -0,0 +1,42 @@
--TEST--
#69017 (Fail to push to the empty array with the constant value defined in class scope)
--FILE--
<?php
class c1
{
const ZERO = 0;
const ONE = 1;
const MAX = PHP_INT_MAX;
public static $a1 = array(self::ONE => 'one');
public static $a2 = array(self::ZERO => 'zero');
public static $a3 = array(self::MAX => 'zero');
}
c1::$a1[] = 1;
c1::$a2[] = 1;
c1::$a3[] = 1;
var_dump(c1::$a1);
var_dump(c1::$a2);
var_dump(c1::$a3);
?>
--EXPECTF--
Warning: Cannot add element to the array as the next element is already occupied in %sbug69017.php on line %d
array(2) {
[1]=>
string(3) "one"
[2]=>
int(1)
}
array(2) {
[0]=>
string(4) "zero"
[1]=>
int(1)
}
array(1) {
[%d]=>
string(4) "zero"
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #69174 (leaks when unused inner class use traits precedence)
--FILE--
<?php
function test() {
class C1 {
use T1, T2 {
T1::foo insteadof T2;
T1::bar insteadof T2;
}
}
}
?>
==DONE==
--EXPECT--
==DONE==
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #69212: Leaking VIA_HANDLER func when exception thrown in __call/... arg passing
--FILE--
<?php
class Test {
public static function __callStatic($method, $args) {}
public function __call($method, $args) {}
}
function do_throw() { throw new Exception; }
try {
Test::foo(do_throw());
} catch (Exception $e) {
echo "Caught!\n";
}
try {
(new Test)->bar(do_throw());
} catch (Exception $e) {
echo "Caught!\n";
}
try {
$f = function () {};
$f->__invoke(do_throw());
} catch (Exception $e) {
echo "Caught!\n";
}
try {
$t = new Test;
$f->__invoke($t->bar(Test::foo(do_throw())));
} catch (Exception $e) {
echo "Caught!\n";
}
?>
--EXPECT--
Caught!
Caught!
Caught!
Caught!
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #69221: Segmentation fault when using a generator in combination with an Iterator
--FILE--
<?php
function gen() {
yield 1;
};
$gen1 = gen();
$gen2 = (object) $gen1;
foreach ($gen1 as $v1) {
foreach ($gen2 as $v2) {
break 2;
}
}
unset($gen1);
foreach ($gen2 as $v) { var_dump($v); }
?>
--EXPECTF--
int(1)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #69221: Segmentation fault when using a generator in combination with an Iterator (2)
--FILE--
<?php
$gen = function() {
yield 1;
};
$iter = new IteratorIterator($gen());
$ngen = $iter->getInnerIterator();
var_dump(iterator_to_array($ngen, false));
?>
--EXPECT--
array(1) {
[0]=>
int(1)
}
+21 -2
View File
@@ -4211,6 +4211,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */
{
size_t i, j = 0;
zend_trait_precedence **precedences;
zend_trait_precedence *cur_precedence;
zend_trait_method_reference *cur_method_ref;
char *lcname;
@@ -4219,7 +4220,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
/* resolve class references */
if (ce->trait_precedences) {
i = 0;
while ((cur_precedence = ce->trait_precedences[i])) {
precedences = ce->trait_precedences;
ce->trait_precedences = NULL;
while ((cur_precedence = precedences[i])) {
/** Resolve classes for all precedence operations. */
if (cur_precedence->exclude_from_classes) {
cur_method_ref = cur_precedence->trait_method;
@@ -4276,6 +4279,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
}
i++;
}
ce->trait_precedences = precedences;
}
if (ce->trait_aliases) {
@@ -4343,16 +4347,20 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
for (i = 0; i < ce->num_traits; i++) {
if (ce->trait_precedences) {
HashTable exclude_table;
zend_trait_precedence **precedences;
/* TODO: revisit this start size, may be its not optimal */
zend_hash_init_ex(&exclude_table, 2, NULL, NULL, 0, 0);
zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]);
precedences = ce->trait_precedences;
ce->trait_precedences = NULL;
zend_traits_compile_exclude_table(&exclude_table, precedences, ce->traits[i]);
/* copies functions, applies defined aliasing, and excludes unused trait methods */
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, &exclude_table);
zend_hash_destroy(&exclude_table);
ce->trait_precedences = precedences;
} else {
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, NULL);
}
@@ -4360,6 +4368,17 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t)zend_fixup_trait_method, ce TSRMLS_CC);
if (ce->trait_precedences) {
i = 0;
while (ce->trait_precedences[i]) {
if (ce->trait_precedences[i]->exclude_from_classes) {
efree(ce->trait_precedences[i]->exclude_from_classes);
ce->trait_precedences[i]->exclude_from_classes = NULL;
}
i++;
}
}
if (overriden) {
zend_hash_destroy(overriden);
FREE_HASHTABLE(overriden);
+5 -1
View File
@@ -587,10 +587,14 @@ ZEND_METHOD(exception, getTraceAsString)
DEFAULT_0_PARAMS;
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
if(Z_TYPE_P(trace) != IS_ARRAY) {
RETURN_FALSE;
}
res = estrdup("");
str = &res;
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace) TSRMLS_CC, (apply_func_args_t)_build_trace_string, 3, str, len, &num);
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
+4 -4
View File
@@ -605,9 +605,9 @@ ZEND_METHOD(Generator, __wakeup)
static void zend_generator_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
{
zval *object = ((zend_generator_iterator *) iterator)->object;
zend_generator_iterator *iter = (zend_generator_iterator *) iterator;
zval_ptr_dtor(&object);
zend_objects_store_del_ref_by_handle(iter->handle TSRMLS_CC);
}
/* }}} */
@@ -699,8 +699,8 @@ zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *ob
/* We have to keep a reference to the generator object zval around,
* otherwise the generator may be destroyed during iteration. */
Z_ADDREF_P(object);
iterator->object = object;
iterator->handle = Z_OBJ_HANDLE_P(object);
zend_objects_store_add_ref_by_handle(iterator->handle TSRMLS_CC);
return (zend_object_iterator *) iterator;
}
+3 -3
View File
@@ -28,9 +28,9 @@ extern ZEND_API zend_class_entry *zend_ce_generator;
typedef struct _zend_generator_iterator {
zend_object_iterator intern;
/* The generator object zval has to be stored, because the iterator is
* holding a ref to it, which has to be dtored. */
zval *object;
/* The generator object handle has to be stored, because the
* iterator is holding a ref to it, which has to be dtored. */
zend_object_handle handle;
} zend_generator_iterator;
typedef struct _zend_generator {
+3
View File
@@ -1269,6 +1269,9 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
if (key_type == HASH_KEY_IS_LONG) {
p->h = num_index;
if ((long)num_index >= (long)ht->nNextFreeElement) {
ht->nNextFreeElement = num_index < LONG_MAX ? num_index + 1 : LONG_MAX;
}
} else {
p->h = h;
p->nKeyLength = str_length;
+6 -1
View File
@@ -256,9 +256,14 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce)
efree(ce->trait_precedences[i]->trait_method);
if (ce->trait_precedences[i]->exclude_from_classes) {
zend_uint j = 0;
zend_trait_precedence *cur_precedence = ce->trait_precedences[i];
while (cur_precedence->exclude_from_classes[j]) {
efree(cur_precedence->exclude_from_classes[j]);
j++;
}
efree(ce->trait_precedences[i]->exclude_from_classes);
}
efree(ce->trait_precedences[i]);
i++;
}
+15 -3
View File
@@ -378,6 +378,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -418,6 +419,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (IS_OP2_TMP_FREE()) {
@@ -636,7 +638,10 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -653,6 +658,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -737,9 +743,10 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -758,6 +765,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -5247,6 +5255,10 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
zval_ptr_dtor(&call->object);
}
if (call->fbc->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
efree((char *) call->fbc->common.function_name);
efree(call->fbc);
}
call--;
} while (call >= EX(call_slots));
EX(call) = NULL;
+142 -36
View File
@@ -1214,6 +1214,10 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
}
zval_ptr_dtor(&call->object);
}
if (call->fbc->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
efree((char *) call->fbc->common.function_name);
efree(call->fbc);
}
call--;
} while (call >= EX(call_slots));
EX(call) = NULL;
@@ -14548,6 +14552,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -14588,6 +14593,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -14805,7 +14811,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -14822,6 +14831,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -14906,9 +14916,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -14927,6 +14938,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -17051,6 +17063,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -17091,6 +17104,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (1) {
@@ -17309,7 +17323,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -17326,6 +17343,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -17410,9 +17428,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -17431,6 +17450,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -19141,6 +19161,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -19181,6 +19202,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -19399,7 +19421,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -19416,6 +19441,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -19500,9 +19526,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -19521,6 +19548,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -21336,6 +21364,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -21376,6 +21405,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -22764,6 +22794,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -22804,6 +22835,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -23021,7 +23053,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -23038,6 +23073,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -23122,9 +23158,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -23143,6 +23180,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -24715,6 +24753,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -24755,6 +24794,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -24971,7 +25011,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -24988,6 +25031,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -25072,9 +25116,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -25093,6 +25138,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -26120,6 +26166,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -26160,6 +26207,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (1) {
@@ -26377,7 +26425,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -26394,6 +26445,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -26478,9 +26530,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -26499,6 +26552,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -27434,6 +27488,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -27474,6 +27529,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -27691,7 +27747,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -27708,6 +27767,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -27792,9 +27852,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -27813,6 +27874,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -28749,6 +28811,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -28789,6 +28852,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -29178,6 +29242,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -29218,6 +29283,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -29434,7 +29500,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -29451,6 +29520,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -29535,9 +29605,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -29556,6 +29627,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -32005,6 +32077,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -32045,6 +32118,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -32261,7 +32335,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -32278,6 +32355,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -32362,9 +32440,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -32383,6 +32462,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -34277,6 +34357,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -34317,6 +34398,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (1) {
@@ -34534,7 +34616,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -34551,6 +34636,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -34635,9 +34721,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -34656,6 +34743,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -36228,6 +36316,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -36268,6 +36357,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -36485,7 +36575,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -36502,6 +36595,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -36586,9 +36680,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -36607,6 +36702,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
@@ -38283,6 +38379,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -38323,6 +38420,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -39562,6 +39660,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
if (!have_get_ptr) {
zval *z = NULL;
Z_ADDREF_P(object);
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (Z_OBJ_HT_P(object)->read_property) {
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
@@ -39602,6 +39701,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
}
}
zval_ptr_dtor(&object);
}
if (0) {
@@ -39818,7 +39918,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -39835,6 +39938,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
incdec_op(z);
*retval = z;
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
SELECTIVE_PZVAL_LOCK(*retval, opline);
zval_ptr_dtor(&z);
} else {
@@ -39919,9 +40023,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
if (!have_get_ptr) {
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval *z_copy;
zval *z, *z_copy;
Z_ADDREF_P(object);
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -39940,6 +40045,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
incdec_op(z_copy);
Z_ADDREF_P(z);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
zval_ptr_dtor(&object);
zval_ptr_dtor(&z_copy);
zval_ptr_dtor(&z);
} else {
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
PHP_RELEASE_VERSION=6
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=8
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+18 -1
View File
@@ -837,6 +837,11 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4);
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5);
#if LIBCURL_VERSION_NUM >= 0x071200 /* Available since 7.18.0 */
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4A);
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5_HOSTNAME);
#endif
/* Curl Share constants */
REGISTER_CURL_CONSTANT(CURLSHOPT_NONE);
REGISTER_CURL_CONSTANT(CURLSHOPT_SHARE);
@@ -845,6 +850,9 @@ PHP_MINIT_FUNCTION(curl)
/* Curl Http Version constants (CURLOPT_HTTP_VERSION) */
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_0);
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_1);
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2_0);
#endif
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_NONE);
/* Curl Lock constants */
@@ -874,6 +882,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURL_VERSION_KERBEROS4);
REGISTER_CURL_CONSTANT(CURL_VERSION_LIBZ);
REGISTER_CURL_CONSTANT(CURL_VERSION_SSL);
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_HTTP2);
#endif
#if LIBCURL_VERSION_NUM >= 0x070a06 /* Available since 7.10.6 */
REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
@@ -1232,7 +1243,7 @@ PHP_MINIT_FUNCTION(curl)
gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl);
#endif
if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) {
if (curl_global_init(CURL_GLOBAL_DEFAULT) != CURLE_OK) {
return FAILURE;
}
@@ -1335,6 +1346,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
length = -1;
} else if (retval_ptr) {
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
convert_to_long_ex(&retval_ptr);
}
@@ -1400,6 +1412,7 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
} else if (retval_ptr) {
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
convert_to_long_ex(&retval_ptr);
}
@@ -1478,6 +1491,7 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
} else if (retval_ptr) {
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
convert_to_long_ex(&retval_ptr);
}
@@ -1555,6 +1569,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
length = CURL_READFUNC_ABORT;
#endif
} else if (retval_ptr) {
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
if (Z_TYPE_P(retval_ptr) == IS_STRING) {
length = MIN((int) (size * nmemb), Z_STRLEN_P(retval_ptr));
memcpy(data, Z_STRVAL_P(retval_ptr), length);
@@ -1629,6 +1644,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
length = -1;
} else if (retval_ptr) {
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
convert_to_long_ex(&retval_ptr);
}
@@ -2836,6 +2852,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC)
curl_easy_setopt(ch->cp, CURLOPT_SHARE, sh->share);
}
}
break;
#if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */
case CURLOPT_FNMATCH_FUNCTION:
+45
View File
@@ -0,0 +1,45 @@
--TEST--
Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
function hdr_callback($ch, $data) {
// close the stream, causing the FILE structure to be free()'d
if($GLOBALS['f_file']) {
fclose($GLOBALS['f_file']); $GLOBALS['f_file'] = 0;
// cause an allocation of approx the same size as a FILE structure, size varies a bit depending on platform/libc
$FILE_size = (PHP_INT_SIZE == 4 ? 0x160 : 0x238);
curl_setopt($ch, CURLOPT_COOKIE, str_repeat("a", $FILE_size - 1));
}
return strlen($data);
}
include 'server.inc';
$host = curl_cli_server_start();
$temp_file = dirname(__FILE__) . '/body.tmp';
$url = "{$host}/get.php?test=getpost";
$ch = curl_init();
$f_file = fopen($temp_file, "w") or die("failed to open file\n");
curl_setopt($ch, CURLOPT_BUFFERSIZE, 10);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, "hdr_callback");
curl_setopt($ch, CURLOPT_FILE, $f_file);
curl_setopt($ch, CURLOPT_URL, $url);
curl_exec($ch);
curl_close($ch);
?>
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/body.tmp');
?>
--EXPECTF--
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
array(1) {
["test"]=>
string(7) "getpost"
}
array(0) {
}
===DONE===
+3 -3
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Mon Aug 18 18:28:27 2014 */
/* Generated by re2c 0.13.5 on Tue Mar 31 16:32:03 2015 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -19864,9 +19864,9 @@ yy1315:
/* skip "last day of" or "first day of" */
if (*ptr == 'l' || *ptr == 'L') {
s->time->relative.first_last_day_of = 2;
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
} else {
s->time->relative.first_last_day_of = 1;
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
}
TIMELIB_DEINIT;
+2 -2
View File
@@ -1030,9 +1030,9 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
/* skip "last day of" or "first day of" */
if (*ptr == 'l' || *ptr == 'L') {
s->time->relative.first_last_day_of = 2;
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
} else {
s->time->relative.first_last_day_of = 1;
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
}
TIMELIB_DEINIT;
+3
View File
@@ -38,6 +38,9 @@
#define TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH 0x02
#define TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH 0x03
#define TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH 0x01
#define TIMELIB_SPECIAL_LAST_DAY_OF_MONTH 0x02
#ifndef LONG_MAX
#define LONG_MAX 2147483647L
#endif
+729 -672
View File
File diff suppressed because it is too large. Load diff
+13 -2
View File
@@ -205,15 +205,17 @@ static void do_adjust_relative(timelib_time* time)
time->m += time->relative.m;
time->y += time->relative.y;
}
switch (time->relative.first_last_day_of) {
case 1: /* first */
case TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH: /* first */
time->d = 1;
break;
case 2: /* last */
case TIMELIB_SPECIAL_LAST_DAY_OF_MONTH: /* last */
time->d = 0;
time->m++;
break;
}
timelib_do_normalize(time);
}
@@ -296,6 +298,15 @@ static void do_adjust_special_early(timelib_time* time)
break;
}
}
switch (time->relative.first_last_day_of) {
case TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH: /* first */
time->d = 1;
break;
case TIMELIB_SPECIAL_LAST_DAY_OF_MONTH: /* last */
time->d = 0;
time->m++;
break;
}
timelib_do_normalize(time);
}
+15 -14
View File
@@ -85,6 +85,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mktime, 0, 0, 0)
ZEND_ARG_INFO(0, mon)
ZEND_ARG_INFO(0, day)
ZEND_ARG_INFO(0, year)
ZEND_ARG_INFO(0, is_dst)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_gmmktime, 0, 0, 0)
@@ -94,6 +95,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmmktime, 0, 0, 0)
ZEND_ARG_INFO(0, mon)
ZEND_ARG_INFO(0, day)
ZEND_ARG_INFO(0, year)
ZEND_ARG_INFO(0, is_dst)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_checkdate, 0)
@@ -163,7 +165,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
ZEND_ARG_INFO(0, format)
ZEND_ARG_INFO(0, time)
ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 1)
ZEND_ARG_INFO(0, object)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_parse, 0, 0, 1)
@@ -2807,12 +2809,9 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
timelib_tzinfo *tzi;
php_timezone_obj *tzobj;
if (zend_hash_find(myht, "date", 5, (void**) &z_date) == SUCCESS) {
convert_to_string(*z_date);
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
convert_to_long(*z_timezone_type);
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
convert_to_string(*z_timezone);
if (zend_hash_find(myht, "date", 5, (void**) &z_date) == SUCCESS && Z_TYPE_PP(z_date) == IS_STRING) {
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS && Z_TYPE_PP(z_timezone_type) == IS_LONG) {
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS && Z_TYPE_PP(z_timezone) == IS_STRING) {
switch (Z_LVAL_PP(z_timezone_type)) {
case TIMELIB_ZONETYPE_OFFSET:
@@ -2827,7 +2826,6 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
case TIMELIB_ZONETYPE_ID: {
int ret;
convert_to_string(*z_timezone);
tzi = php_date_parse_tzfile(Z_STRVAL_PP(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
@@ -3019,7 +3017,7 @@ void php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAMETERS, timelib_time *
add_assoc_long(element, "weekdays", parsed_time->relative.special.amount);
}
if (parsed_time->relative.first_last_day_of) {
add_assoc_bool(element, parsed_time->relative.first_last_day_of == 1 ? "first_day_of_month" : "last_day_of_month", 1);
add_assoc_bool(element, parsed_time->relative.first_last_day_of == TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH ? "first_day_of_month" : "last_day_of_month", 1);
}
add_assoc_zval(return_value, "relative", element);
}
@@ -3744,9 +3742,8 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez
zval **z_timezone = NULL;
zval **z_timezone_type = NULL;
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
convert_to_long(*z_timezone_type);
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS && Z_TYPE_PP(z_timezone_type) == IS_LONG) {
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS && Z_TYPE_PP(z_timezone) == IS_STRING) {
if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_PP(z_timezone) TSRMLS_CC)) {
return SUCCESS;
}
@@ -3771,7 +3768,9 @@ PHP_METHOD(DateTimeZone, __set_state)
php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC);
tzobj = (php_timezone_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC) != SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone initialization failed");
}
}
/* }}} */
@@ -3787,7 +3786,9 @@ PHP_METHOD(DateTimeZone, __wakeup)
myht = Z_OBJPROP_P(object);
php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC) != SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone initialization failed");
}
}
/* }}} */
+1
View File
@@ -197,6 +197,7 @@ PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D);
/* Grabbing CE's so that other exts can use the date objects too */
PHPAPI zend_class_entry *php_date_get_date_ce(void);
PHPAPI zend_class_entry *php_date_get_immutable_ce(void);
PHPAPI zend_class_entry *php_date_get_timezone_ce(void);
/* Functions for creating DateTime objects, and initializing them from a string */
-17
View File
@@ -1,17 +0,0 @@
--TEST--
Bug #55407 (Impossible to prototype DateTime::createFromFormat)
--INI--
error_reporting=-1
--FILE--
<?php namespace melt\core;
class DateTime extends \DateTime {
public static function createFromFormat($format, $time, DateTimeZone $timezone = null) {
return new DateTime(parent::createFromFormat($format, $time, $timezone));
}
}
echo "DONE\n";
?>
--EXPECTF--
DONE
+9
View File
@@ -0,0 +1,9 @@
--TEST--
Bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone).
--FILE--
<?php
$data = unserialize('a:2:{i:0;O:12:"DateTimeZone":2:{s:13:"timezone_type";a:2:{i:0;i:1;i:1;i:2;}s:8:"timezone";s:1:"A";}i:1;R:4;}');
var_dump($data);
?>
--EXPECTF--
Fatal error: DateTimeZone::__wakeup(): Timezone initialization failed in %s/bug68942.php on line %d
+9
View File
@@ -0,0 +1,9 @@
--TEST--
Bug #68942 (Use after free vulnerability in unserialize() with DateTime).
--FILE--
<?php
$data = unserialize('a:2:{i:0;O:8:"DateTime":3:{s:4:"date";s:26:"2000-01-01 00:00:00.000000";s:13:"timezone_type";a:2:{i:0;i:1;i:1;i:2;}s:8:"timezone";s:1:"A";}i:1;R:5;}');
var_dump($data);
?>
--EXPECTF--
Fatal error: Invalid serialization data for DateTime object in %s/bug68942_2.php on line %d
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #69336 (Issues with "last day of <monthname>")
--INI--
date.timezone=UTC
--FILE--
<?php
var_dump(date('d.m.Y',strtotime('last day of april')));
var_dump(date('d.m.Y',strtotime('last tuesday of march 2015')));
var_dump(date('d.m.Y',strtotime('last wednesday of march 2015')));
var_dump(date('d.m.Y',strtotime('last wednesday of april 2015')));
var_dump(date('d.m.Y',strtotime('last wednesday of march 2014')));
var_dump(date('d.m.Y',strtotime('last wednesday of april 2014')));
?>
--EXPECTF--
string(10) "30.04.%d"
string(10) "31.03.2015"
string(10) "25.03.2015"
string(10) "29.04.2015"
string(10) "26.03.2014"
string(10) "30.04.2014"
+59 -55
View File
@@ -187,10 +187,10 @@ ZEND_END_ARG_INFO();
/* }}} */
/*
* class DOMDocument extends DOMNode
* class DOMDocument extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document
* Since:
* Since:
*/
const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
@@ -235,10 +235,10 @@ const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
};
/* }}} */
/* {{{ docType DOMDocumentType
readonly=yes
/* {{{ docType DOMDocumentType
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
Since:
Since:
*/
int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
{
@@ -266,15 +266,15 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
return FAILURE;
}
return SUCCESS;
}
/* }}} */
/* {{{ implementation DOMImplementation
readonly=yes
/* {{{ implementation DOMImplementation
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
Since:
Since:
*/
int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
{
@@ -285,10 +285,10 @@ int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
/* }}} */
/* {{{ documentElement DOMElement
readonly=yes
/* {{{ documentElement DOMElement
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
Since:
Since:
*/
int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
{
@@ -384,8 +384,8 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
/* {{{ standalone boolean
readonly=no
/* {{{ standalone boolean
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
Since: DOM Level 3
*/
@@ -443,7 +443,7 @@ int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
/* {{{ version string
/* {{{ version string
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
Since: DOM Level 3
@@ -501,8 +501,8 @@ int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
/* {{{ strictErrorChecking boolean
readonly=no
/* {{{ strictErrorChecking boolean
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
Since: DOM Level 3
*/
@@ -541,7 +541,7 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRML
/* }}} */
/* {{{ formatOutput boolean
/* {{{ formatOutput boolean
readonly=no
*/
int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -578,7 +578,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
}
/* }}} */
/* {{{ validateOnParse boolean
/* {{{ validateOnParse boolean
readonly=no
*/
int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -615,7 +615,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC
}
/* }}} */
/* {{{ resolveExternals boolean
/* {{{ resolveExternals boolean
readonly=no
*/
int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -652,7 +652,7 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC
}
/* }}} */
/* {{{ preserveWhiteSpace boolean
/* {{{ preserveWhiteSpace boolean
readonly=no
*/
int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -689,7 +689,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
}
/* }}} */
/* {{{ recover boolean
/* {{{ recover boolean
readonly=no
*/
int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -726,7 +726,7 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
}
/* }}} */
/* {{{ substituteEntities boolean
/* {{{ substituteEntities boolean
readonly=no
*/
int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -763,8 +763,8 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D
}
/* }}} */
/* {{{ documentURI string
readonly=no
/* {{{ documentURI string
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
Since: DOM Level 3
*/
@@ -820,8 +820,8 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
/* {{{ config DOMConfiguration
readonly=yes
/* {{{ config DOMConfiguration
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
Since: DOM Level 3
*/
@@ -836,7 +836,7 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_element)
{
@@ -869,7 +869,7 @@ PHP_FUNCTION(dom_document_create_element)
/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment();
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_document_fragment)
{
@@ -896,7 +896,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
/* {{{ proto DOMText dom_document_create_text_node(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_text_node)
{
@@ -924,7 +924,7 @@ PHP_FUNCTION(dom_document_create_text_node)
/* {{{ proto DOMComment dom_document_create_comment(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_comment)
{
@@ -952,7 +952,7 @@ PHP_FUNCTION(dom_document_create_comment)
/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_cdatasection)
{
@@ -980,7 +980,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_processing_instruction)
{
@@ -1015,7 +1015,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
/* {{{ proto DOMAttr dom_document_create_attribute(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_attribute)
{
@@ -1049,7 +1049,7 @@ PHP_FUNCTION(dom_document_create_attribute)
/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE
Since:
Since:
*/
PHP_FUNCTION(dom_document_create_entity_reference)
{
@@ -1082,7 +1082,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094
Since:
Since:
*/
PHP_FUNCTION(dom_document_get_elements_by_tag_name)
{
@@ -1116,7 +1116,7 @@ PHP_FUNCTION(dom_document_import_node)
xmlDocPtr docp;
xmlNodePtr nodep, retnodep;
dom_object *intern, *nodeobj;
int ret;
int ret;
long recursive = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
@@ -1127,7 +1127,7 @@ PHP_FUNCTION(dom_document_import_node)
DOM_GET_OBJ(nodep, node, xmlNodePtr, nodeobj);
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
|| nodep->type == XML_DOCUMENT_TYPE_NODE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported");
RETURN_FALSE;
@@ -1217,7 +1217,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
RETURN_FALSE;
}
nodep->ns = nsptr;
DOM_RET_OBJ(nodep, &ret, intern);
@@ -1519,11 +1519,15 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int sourc
xmlInitParser();
if (mode == DOM_LOAD_FILE) {
char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
char *file_dest;
if (CHECK_NULL_PATH(source, source_len)) {
return NULL;
}
file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
if (file_dest) {
ctxt = xmlCreateFileParserCtxt(file_dest);
}
} else {
ctxt = xmlCreateMemoryParserCtxt(source, source_len);
}
@@ -1845,7 +1849,7 @@ PHP_FUNCTION(dom_document_xinclude)
zval *id;
xmlDoc *docp;
xmlNodePtr root;
long flags = 0;
long flags = 0;
int err;
dom_object *intern;
@@ -1858,7 +1862,7 @@ PHP_FUNCTION(dom_document_xinclude)
err = xmlXIncludeProcessFlags(docp, flags);
/* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
but are not wanted in resulting document - must be done even if err as it could fail after
having processed some xincludes */
root = (xmlNodePtr) docp->children;
@@ -1874,7 +1878,7 @@ PHP_FUNCTION(dom_document_xinclude)
} else {
RETVAL_FALSE;
}
}
/* }}} */
@@ -1895,19 +1899,19 @@ PHP_FUNCTION(dom_document_validate)
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
cvp = xmlNewValidCtxt();
cvp->userData = NULL;
cvp->error = (xmlValidityErrorFunc) php_libxml_error_handler;
cvp->warning = (xmlValidityErrorFunc) php_libxml_error_handler;
if (xmlValidateDocument(cvp, docp)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
}
xmlFreeValidCtxt(cvp);
}
/* }}} */
@@ -1948,7 +1952,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
break;
case DOM_LOAD_STRING:
parser = xmlSchemaNewMemParserCtxt(source, source_len);
/* If loading from memory, we need to set the base directory for the document
/* If loading from memory, we need to set the base directory for the document
but it is not apparent how to do that for schema's */
break;
default:
@@ -2044,7 +2048,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
break;
case DOM_LOAD_STRING:
parser = xmlRelaxNGNewMemParserCtxt(source, source_len);
/* If loading from memory, we need to set the base directory for the document
/* If loading from memory, we need to set the base directory for the document
but it is not apparent how to do that for schema's */
break;
default:
@@ -2112,10 +2116,10 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
int source_len, refcount, ret;
long options = 0;
htmlParserCtxtPtr ctxt;
id = getThis();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &source, &source_len, &options) == FAILURE) {
return;
}
@@ -2148,7 +2152,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
htmlParseDocument(ctxt);
newdoc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
if (!newdoc)
RETURN_FALSE;
@@ -2270,13 +2274,13 @@ PHP_FUNCTION(dom_document_save_html)
php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
if (node->type == XML_DOCUMENT_FRAG_NODE) {
int one_size;
@@ -13,6 +13,11 @@ assert.bail=true
$doc = new DOMDocument();
$result = $doc->loadHTMLFile("");
assert('$result === false');
$doc = new DOMDocument();
$result = $doc->loadHTMLFile("text.html\0something");
assert('$result === null');
?>
--EXPECTF--
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile() expects parameter 1 to be a valid path, string given %s
+3 -4
View File
@@ -550,13 +550,12 @@ PHP_FUNCTION(enchant_broker_request_dict)
d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
if (d) {
pos = pbroker->dictcnt++;
if (pbroker->dictcnt) {
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
pos = pbroker->dictcnt++;
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
pbroker->dictcnt++;
}
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
@@ -607,14 +606,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
if (d) {
pos = pbroker->dictcnt++;
if (pbroker->dictcnt) {
pos = pbroker->dictcnt++;
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
pbroker->dictcnt++;
}
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
dict->id = pos;
dict->pbroker = pbroker;
+13 -1
View File
@@ -117,7 +117,15 @@ int cflags;
(NC-1)*sizeof(cat_t));
if (g == NULL)
return(REG_ESPACE);
p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */
{
/* Patched for CERT Vulnerability Note VU#695940, Feb 2015. */
size_t new_ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */
if (new_ssize < len || new_ssize > LONG_MAX / sizeof(sop)) {
free((char *) g);
return REG_INVARG;
}
p->ssize = new_ssize;
}
p->strip = (sop *)malloc(p->ssize * sizeof(sop));
p->slen = 0;
if (p->strip == NULL) {
@@ -1276,6 +1284,10 @@ int c;
register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
register unsigned uc = (unsigned char)c;
if (!g->setbits) {
return(0);
}
for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
if (col[uc] != 0)
return(1);
+5
View File
@@ -508,6 +508,11 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
RETVAL_FALSE;
goto clean;
}
if (CHECK_NULL_PATH(buffer, buffer_len)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
RETVAL_FALSE;
goto clean;
}
wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
+3
View File
@@ -1072,6 +1072,9 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
if (bytecnt > nbytes) {
bytecnt = nbytes;
}
if (offset > bytecnt) {
offset = bytecnt;
}
if (s == NULL) {
ms->search.s_len = 0;
ms->search.s = NULL;
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #68819 Fileinfo on specific file causes spurious OOM and/or segfault, var 1
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$string = <<<HERE
----a-----'''---------a---------------a--------a-----a-----a---------a-----as-------a----a--a-------------a--as-----s---------------a---------a---a--s-a-----a-----------asy---------a-----a-----------a----s--------a-------------a-------a--------a----s------------a-----a----------------a----s-----------------\r\n-------------------a-------a-a-------a-----a----a----s----s--------a-----------------------a----a----s-------------a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a----s----s--------a----------a----------------------a----a----s-------------a----------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n------a-------a-a-------a-----a----a---a-----a-----------------------a----a---a-----a------------------s-------a----a---a-----a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s------\r\n-------------------a-------a-a-------a-----a----a---a-------a------------------------a----a---a-----''--a-------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a-------s-----a---a-------------------------a----a-------------a---a-------------------s-------a----a-------------a---a-----as-a--------------a-----a--s----s---------y------------a-----a-s---a-------''----a---s--a-''------''----s------------a-y----------------s------a-----y--a-s--a-s------s--a-s----------''----------------------------a---s--a----a---------a-s---a-s--------s--------a---------s--a-y-------------as----a----a-------------a------a---s--a-s------a--------a----s----y--as--a----a-s---------------a-----a--------------------------------------\r\n-------------------a-------a-a-------a-----a----a-----------s--------a-----------------------a----a--------------------a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a-----------s--------a----------a----------------------a----a--------------------a------------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a---a-----------------------a----a---a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a---a----------a----------------------a----a---a------------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-----a-a-----------a-------a-a-------a-----a----a----a---s-----a-----------------------a----a----a---------a-----------------s-------a----a----a---------a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a--------a----a-----------------------a----a----------a----a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-----a-------------a-------a-a-------a-----a----a--------s-----a---a-------------------------a----a--------------a---a-------------------s-------------a---------------a----a---a---a-----as-a--------------a-----a--s----s---------y------------a-----a-s---a-------''----a---s--a-''------''----s------------a-y----------------s------a-----y--a-s--a-s------s--a-s----------''----------------------------a---s--a----a---------a-s---a-s--------s--------a---------s--a-y-------------as----a----a-------------a------a---s--a-s------a--------a----s----y--as--a----a-s---------------a-----a-----------Line truncated
HERE;
$finfo = new finfo();
$type = $finfo->buffer($string);
var_dump($type);
?>
--EXPECT--
string(60) "ASCII text, with very long lines, with CRLF line terminators"
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #68819 Fileinfo on specific file causes spurious OOM and/or segfault, var 2
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$string = '';
// These two in any order
$string .= "\r\n";
$string .= "''''";
// Total string length > 8192
$string .= str_repeat(chr(rand(32, 127)), 8184);
// Ending in this string
$string .= "say";
$finfo = new finfo();
$type = $finfo->buffer($string);
var_dump($type);
?>
--EXPECT--
string(60) "ASCII text, with very long lines, with CRLF line terminators"
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #68996 (Invalid free of CG(interned_empty_string))
--SKIPIF--
<?php
if (getenv("USE_ZEND_ALLOC") !== "0") {
print "skip Need Zend MM disabled";
}
?>
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--INI--
html_errors=1
--FILE--
<?php
finfo_open(FILEINFO_MIME_TYPE, "\xfc\x63");
?>
--EXPECTF--
<br />
<b>Warning</b>: : failed to open stream: No such file or directory in <b>%sbug68996.php</b> on line <b>%d</b><br />
<br />
<b>Warning</b>: : failed to open stream: No such file or directory in <b>%sbug68996.php</b> on line <b>%d</b><br />
<br />
<b>Warning</b>: finfo_open(): in <b>%sbug68996.php</b> on line <b>%d</b><br />
+4
View File
@@ -19,6 +19,7 @@ echo "*** Testing finfo_file() : basic functionality ***\n";
var_dump( finfo_file( $finfo, __FILE__) );
var_dump( finfo_file( $finfo, __FILE__, FILEINFO_CONTINUE ) );
var_dump( finfo_file( $finfo, $magicFile ) );
var_dump( finfo_file( $finfo, $magicFile.chr(0).$magicFile) );
?>
===DONE===
@@ -27,4 +28,7 @@ var_dump( finfo_file( $finfo, $magicFile ) );
string(28) "text/x-php; charset=us-ascii"
string(22) "PHP script, ASCII text"
string(25) "text/plain; charset=utf-8"
Warning: finfo_file(): Invalid path in %s/finfo_file_basic.php on line %d
bool(false)
===DONE===
+2 -2
View File
@@ -113,7 +113,7 @@ static void php_filter_strip(zval *value, long flags)
int i, c;
/* Optimization for if no strip flags are set */
if (! ((flags & FILTER_FLAG_STRIP_LOW) || (flags & FILTER_FLAG_STRIP_HIGH)) ) {
if (!(flags & (FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK))) {
return;
}
@@ -121,7 +121,7 @@ static void php_filter_strip(zval *value, long flags)
buf = safe_emalloc(1, Z_STRLEN_P(value) + 1, 1);
c = 0;
for (i = 0; i < Z_STRLEN_P(value); i++) {
if ((str[i] > 127) && (flags & FILTER_FLAG_STRIP_HIGH)) {
if ((str[i] >= 127) && (flags & FILTER_FLAG_STRIP_HIGH)) {
} else if ((str[i] < 32) && (flags & FILTER_FLAG_STRIP_LOW)) {
} else if ((str[i] == '`') && (flags & FILTER_FLAG_STRIP_BACKTICK)) {
} else {
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #69202 (FILTER_FLAG_STRIP_BACKTICK ignored unless other flags are used)
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_BACKTICK));
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK));
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK));
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH));
?>
--EXPECT--
string(3) "abc"
string(3) "abc"
string(3) "abc"
string(9) "``a`b`c``"
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #69203 (FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127)
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_var("\x7f", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH));
var_dump(filter_var("\x7f", FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH));
var_dump(filter_var("\x7f", FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_HIGH));
var_dump(filter_var("\x7f", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_HIGH));
?>
--EXPECT--
string(0) ""
string(0) ""
string(0) ""
string(0) ""
+4 -4
View File
@@ -1432,7 +1432,7 @@ PHP_FUNCTION(imageloadfont)
gdFontPtr font;
php_stream *stream;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_name) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_name) == FAILURE) {
return;
}
@@ -2369,7 +2369,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
long ignore_warning;
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
return;
}
if (width < 1 || height < 1) {
@@ -2377,7 +2377,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
} else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_len) == FAILURE) {
return;
}
}
@@ -4046,7 +4046,7 @@ PHP_FUNCTION(imagepsencodefont)
char *enc, **enc_vector;
int enc_len, *f_ind;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &fnt, &enc, &enc_len) == FAILURE) {
return;
}
+1 -1
View File
@@ -41,7 +41,7 @@
/*********************************************************/
#include <stdlib.h>
#ifdef HAVE_MALLOC_H
#if (!defined(__OpenBSD__)) && HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifndef NULL
+3 -3
View File
@@ -3,7 +3,7 @@ Testing that imageloadfont() breaks on non-string first parameter
--CREDITS--
Neveo Harrison <neveoo [at] gmail [dot] com> #testfest #tek11
--SKIPIF--
<?php
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
@@ -11,5 +11,5 @@ Neveo Harrison <neveoo [at] gmail [dot] com> #testfest #tek11
var_dump( imageloadfont(array()) );
?>
--EXPECTF--
Warning: imageloadfont() expects parameter 1 to be string, array given in %s on line %d
NULL
Warning: imageloadfont() expects parameter 1 to be a valid path, array given in %s on line %d
NULL
+6 -1
View File
@@ -143,6 +143,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
}
if (isfilename) {
if (CHECK_NULL_PATH(data, data_len)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
RETURN_FALSE;
}
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
@@ -258,6 +259,10 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
RETURN_FALSE;
}
if (isfilename) {
if (CHECK_NULL_PATH(data, data_len)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
RETURN_FALSE;
}
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
if (!stream) {
/* Stream will report errors opening file */
@@ -462,7 +467,7 @@ PHP_FUNCTION(hash_update_file)
char *filename, buf[1024];
int filename_len, n;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
return;
}
+7
View File
@@ -28,6 +28,9 @@ hash_hmac_file('crc32', $file, $key, TRUE, $extra_arg);
echo "\n-- Testing hash_hmac_file() function with invalid hash algorithm --\n";
hash_hmac_file('foo', $file, $key, TRUE);
echo "\n-- Testing hash_hmac_file() function with bad path --\n";
hash_hmac_file('crc32', $file.chr(0).$file, $key, TRUE);
?>
===Done===
--EXPECTF--
@@ -51,4 +54,8 @@ Warning: hash_hmac_file() expects at most 4 parameters, 5 given in %s on line %d
-- Testing hash_hmac_file() function with invalid hash algorithm --
Warning: hash_hmac_file(): Unknown hashing algorithm: foo in %s on line %d
-- Testing hash_hmac_file() function with bad path --
Warning: hash_hmac_file(): Invalid path in %s on line %d
===Done===
-2
View File
@@ -1194,14 +1194,12 @@ static int strToMatch(const char* str ,char *retstr)
char* anchor = NULL;
const char* anchor1 = NULL;
int result = 0;
int len = 0;
if( (!str) || str[0] == '\0'){
return result;
} else {
anchor = retstr;
anchor1 = str;
len = strlen(str);
while( (*str)!='\0' ){
if( *str == '-' ){
*retstr = '_';
+12 -16
View File
@@ -427,25 +427,21 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
if ((type = is_numeric_string(s, len, &p, &d, 0)) != 0) {
if (type == IS_LONG) {
smart_str_append_long(buf, p);
} else if (type == IS_DOUBLE) {
if (!zend_isinf(d) && !zend_isnan(d)) {
char num[NUM_BUF_SIZE];
int l;
return;
} else if (type == IS_DOUBLE && !zend_isinf(d) && !zend_isnan(d)) {
char num[NUM_BUF_SIZE];
int l;
php_gcvt(d, EG(precision), '.', 'e', (char *)num);
l = strlen(num);
if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && l < NUM_BUF_SIZE - 2) {
num[l++] = '.';
num[l++] = '0';
num[l] = '\0';
}
smart_str_appendl(buf, num, l);
} else {
JSON_G(error_code) = PHP_JSON_ERROR_INF_OR_NAN;
smart_str_appendc(buf, '0');
php_gcvt(d, EG(precision), '.', 'e', (char *)num);
l = strlen(num);
if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && l < NUM_BUF_SIZE - 2) {
num[l++] = '.';
num[l++] = '0';
num[l] = '\0';
}
smart_str_appendl(buf, num, l);
return;
}
return;
}
}
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #64695 JSON_NUMERIC_CHECK has issues with strings that are numbers plus the letter e
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
$t = array('test' => '123343e871700');
var_dump(json_encode($t, JSON_NUMERIC_CHECK));
echo "Done\n";
?>
--EXPECT--
string(24) "{"test":"123343e871700"}"
Done
+15
View File
@@ -306,6 +306,21 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
(xmlStrncmp(BAD_CAST uri->scheme, BAD_CAST "file", 4) == 0))) {
resolved_path = xmlURIUnescapeString(filename, 0, NULL);
isescaped = 1;
#if LIBXML_VERSION >= 20902 && defined(PHP_WIN32)
/* Libxml 2.9.2 prefixes local paths with file:/ instead of file://,
thus the php stream wrapper will fail on a valid case. For this
reason the prefix is rather better cut off. */
{
size_t pre_len = sizeof("file:/") - 1;
if (strncasecmp(resolved_path, "file:/", pre_len) == 0
&& '/' != resolved_path[pre_len]) {
xmlChar *tmp = xmlStrdup(resolved_path + pre_len);
xmlFree(resolved_path);
resolved_path = tmp;
}
}
#endif
} else {
resolved_path = (char *)filename;
}
@@ -239,7 +239,7 @@ mbfl_filt_conv_gb18030_wchar(int c, mbfl_convert_filter *filter)
if (((c1 >= 0x81 && c1 <= 0x84) || (c1 >= 0x90 && c1 <= 0xe3)) &&
c2 >= 0x30 && c2 <= 0x39 && c3 >= 0x81 && c3 <= 0xfe && c >= 0x30 && c <= 0x39) {
if (c1 >= 0x90 && c1 <= 0xe3) {
w = ((c1 - 0x90)*10 + (c2 - 0x30)*126 + (c3 - 0x81))*10 + (c - 0x30) + 0x10000;
w = ((((c1 - 0x90)*10 + (c2 - 0x30))*126 + (c3 - 0x81)))*10 + (c - 0x30) + 0x10000;
} else { /* Unicode BMP */
w = (((c1 - 0x81)*10 + (c2 - 0x30))*126 + (c3 - 0x81))*10 + (c - 0x30);
if (w >= 0 && w <= 39419) {
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #68846 False detection of CJK Unified Ideographs Extension E
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
var_dump(
"\x00\x02\x0b\xb7" === mb_convert_encoding("\x95\x34\xb2\x35", 'UTF-32', 'GB18030')
);
?>
--EXPECT--
bool(true)
+2 -2
View File
@@ -8,8 +8,8 @@
$driver = new mysqli_driver;
$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost";
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "127.0.0.1";
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3308;
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
+57 -14
View File
@@ -99,12 +99,17 @@ AC_DEFUN([PHP_ODBC_FIND_EMPRESS_BCS_LIBS],[
dnl
dnl configure options
dnl
PHP_ARG_WITH(odbcver,,
[ --with-odbcver[=HEX] Force support for the passed ODBC version. A hex number is expected, default 0x0300.
Use the special value of 0 to prevent an explicit ODBCVER to be defined. ], 0x0300)
if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(adabas,,
[ --with-adabas[=DIR] Include Adabas D support [/usr/local]])
AC_MSG_CHECKING([for Adabas support])
if test "$PHP_ADABAS" != "no"; then
AC_MSG_CHECKING([for Adabas support])
if test "$PHP_ADABAS" = "yes"; then
PHP_ADABAS=/usr/local
fi
@@ -123,6 +128,8 @@ PHP_ARG_WITH(adabas,,
PHP_ODBC_CHECK_HEADER(sqlext.h)
AC_DEFINE(HAVE_ADABAS,1,[ ])
AC_MSG_RESULT([$ext_output])
else
AC_MSG_RESULT(no)
fi
fi
@@ -130,8 +137,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(sapdb,,
[ --with-sapdb[=DIR] Include SAP DB support [/usr/local]])
AC_MSG_CHECKING([for SAP DB support])
if test "$PHP_SAPDB" != "no"; then
AC_MSG_CHECKING([for SAP DB support])
if test "$PHP_SAPDB" = "yes"; then
PHP_SAPDB=/usr/local
fi
@@ -141,6 +148,8 @@ PHP_ARG_WITH(sapdb,,
ODBC_TYPE=sapdb
AC_DEFINE(HAVE_SAPDB,1,[ ])
AC_MSG_RESULT([$ext_output])
else
AC_MSG_RESULT(no)
fi
fi
@@ -148,8 +157,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(solid,,
[ --with-solid[=DIR] Include Solid support [/usr/local/solid]])
AC_MSG_CHECKING(for Solid support)
if test "$PHP_SOLID" != "no"; then
AC_MSG_CHECKING(for Solid support)
if test "$PHP_SOLID" = "yes"; then
PHP_SOLID=/usr/local/solid
fi
@@ -166,6 +175,8 @@ PHP_ARG_WITH(solid,,
fi
AC_MSG_RESULT([$ext_output])
PHP_ODBC_FIND_SOLID_LIBS($ODBC_LIBDIR)
else
AC_MSG_RESULT(no)
fi
fi
@@ -173,8 +184,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(ibm-db2,,
[ --with-ibm-db2[=DIR] Include IBM DB2 support [/home/db2inst1/sqllib]])
AC_MSG_CHECKING(for IBM DB2 support)
if test "$PHP_IBM_DB2" != "no"; then
AC_MSG_CHECKING(for IBM DB2 support)
if test "$PHP_IBM_DB2" = "yes"; then
ODBC_INCDIR=/home/db2inst1/sqllib/include
ODBC_LIBDIR=/home/db2inst1/sqllib/lib
@@ -203,6 +214,8 @@ You need to source your DB2 environment before running PHP configure:
], [
$ODBC_LFLAGS $ODBC_LIBS
])
else
AC_MSG_RESULT(no)
fi
fi
@@ -210,8 +223,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(ODBCRouter,,
[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support [/usr]])
AC_MSG_CHECKING(for ODBCRouter.com support)
if test "$PHP_ODBCROUTER" != "no"; then
AC_MSG_CHECKING(for ODBCRouter.com support)
if test "$PHP_ODBCROUTER" = "yes"; then
PHP_ODBCROUTER=/usr
fi
@@ -223,6 +236,8 @@ PHP_ARG_WITH(ODBCRouter,,
ODBC_TYPE=ODBCRouter
AC_DEFINE(HAVE_ODBC_ROUTER,1,[ ])
AC_MSG_RESULT([$ext_output])
else
AC_MSG_RESULT(no)
fi
fi
@@ -231,8 +246,8 @@ PHP_ARG_WITH(empress,,
[ --with-empress[=DIR] Include Empress support [\$EMPRESSPATH]
(Empress Version >= 8.60 required)])
AC_MSG_CHECKING(for Empress support)
if test "$PHP_EMPRESS" != "no"; then
AC_MSG_CHECKING(for Empress support)
if test "$PHP_EMPRESS" = "yes"; then
ODBC_INCDIR=$EMPRESSPATH/include/odbc
ODBC_LIBDIR=$EMPRESSPATH/shlib
@@ -246,6 +261,8 @@ PHP_ARG_WITH(empress,,
AC_DEFINE(HAVE_EMPRESS,1,[ ])
AC_MSG_RESULT([$ext_output])
PHP_ODBC_FIND_EMPRESS_LIBS($ODBC_LIBDIR)
else
AC_MSG_RESULT(no)
fi
fi
@@ -255,8 +272,8 @@ PHP_ARG_WITH(empress-bcs,,
Include Empress Local Access support [\$EMPRESSPATH]
(Empress Version >= 8.60 required)])
AC_MSG_CHECKING(for Empress local access support)
if test "$PHP_EMPRESS_BCS" != "no"; then
AC_MSG_CHECKING(for Empress local access support)
if test "$PHP_EMPRESS_BCS" = "yes"; then
ODBC_INCDIR=$EMPRESSPATH/include/odbc
ODBC_LIBDIR=$EMPRESSPATH/shlib
@@ -286,6 +303,8 @@ PHP_ARG_WITH(empress-bcs,,
AC_DEFINE(HAVE_EMPRESS,1,[ ])
AC_MSG_RESULT([$ext_output])
PHP_ODBC_FIND_EMPRESS_BCS_LIBS($ODBC_LIBDIR)
else
AC_MSG_RESULT(no)
fi
fi
@@ -293,8 +312,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(birdstep,,
[ --with-birdstep[=DIR] Include Birdstep support [/usr/local/birdstep]])
AC_MSG_CHECKING(for Birdstep support)
if test "$PHP_BIRDSTEP" != "no"; then
AC_MSG_CHECKING(for Birdstep support)
if test "$PHP_BIRDSTEP" = "yes"; then
ODBC_INCDIR=/usr/local/birdstep/include
ODBC_LIBDIR=/usr/local/birdstep/lib
@@ -333,6 +352,8 @@ PHP_ARG_WITH(birdstep,,
AC_DEFINE(HAVE_BIRDSTEP,1,[ ])
AC_MSG_RESULT([$ext_output])
else
AC_MSG_RESULT(no)
fi
fi
@@ -347,8 +368,8 @@ PHP_ARG_WITH(custom-odbc,,
LDFLAGS=-lunix
CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"])
AC_MSG_CHECKING(for a custom ODBC support)
if test "$PHP_CUSTOM_ODBC" != "no"; then
AC_MSG_CHECKING(for a custom ODBC support)
if test "$PHP_CUSTOM_ODBC" = "yes"; then
PHP_CUSTOM_ODBC=/usr/local
fi
@@ -360,15 +381,17 @@ PHP_ARG_WITH(custom-odbc,,
ODBC_TYPE=custom-odbc
AC_DEFINE(HAVE_CODBC,1,[ ])
AC_MSG_RESULT([$ext_output])
else
AC_MSG_RESULT(no)
fi
fi
if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(iodbc,,
[ --with-iodbc[=DIR] Include iODBC support])
[ --with-iodbc[=DIR] Include iODBC support [/usr/local]])
AC_MSG_CHECKING(for iODBC support)
if test "$PHP_IODBC" != "no"; then
AC_MSG_CHECKING(for iODBC support)
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
@@ -396,6 +419,8 @@ PHP_ARG_WITH(iodbc,,
AC_DEFINE(HAVE_ODBC2,1,[ ])
AC_MSG_RESULT([$ext_output])
fi
else
AC_MSG_RESULT(no)
fi
fi
@@ -403,8 +428,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(esoob,,
[ --with-esoob[=DIR] Include Easysoft OOB support [/usr/local/easysoft/oob/client]])
AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support)
if test "$PHP_ESOOB" != "no"; then
AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support)
if test "$PHP_ESOOB" = "yes"; then
PHP_ESOOB=/usr/local/easysoft/oob/client
fi
@@ -416,6 +441,8 @@ PHP_ARG_WITH(esoob,,
ODBC_TYPE=esoob
AC_DEFINE(HAVE_ESOOB,1,[ ])
AC_MSG_RESULT([$ext_output])
else
AC_MSG_RESULT(no)
fi
fi
@@ -423,8 +450,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(unixODBC,,
[ --with-unixODBC[=DIR] Include unixODBC support [/usr/local]])
AC_MSG_CHECKING(for unixODBC support)
if test "$PHP_UNIXODBC" != "no"; then
AC_MSG_CHECKING(for unixODBC support)
if test "$PHP_UNIXODBC" = "yes"; then
PHP_UNIXODBC=/usr/local
fi
@@ -437,6 +464,8 @@ PHP_ARG_WITH(unixODBC,,
PHP_ODBC_CHECK_HEADER(sqlext.h)
AC_DEFINE(HAVE_UNIXODBC,1,[ ])
AC_MSG_RESULT([$ext_output])
else
AC_MSG_RESULT(no)
fi
fi
@@ -444,8 +473,8 @@ if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(dbmaker,,
[ --with-dbmaker[=DIR] Include DBMaker support])
AC_MSG_CHECKING(for DBMaker support)
if test "$PHP_DBMAKER" != "no"; then
AC_MSG_CHECKING(for DBMaker support)
if test "$PHP_DBMAKER" = "yes"; then
# find dbmaker's home directory
DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'`
@@ -487,9 +516,20 @@ PHP_ARG_WITH(dbmaker,,
PHP_ADD_INCLUDE($ODBC_INCDIR)
ODBC_STATIC="libphpext_odbc.la"
fi
else
AC_MSG_RESULT(no)
fi
fi
if test "no" != "$PHP_ODBCVER"; then
if test "$PHP_ODBCVER" != "0"; then
AC_DEFINE_UNQUOTED(ODBCVER, $PHP_ODBCVER, [ The highest supported ODBC version ])
fi
else
AC_DEFINE(ODBCVER, 0x0300, [ The highest supported ODBC version ])
fi
dnl
dnl Extension setup
dnl
@@ -511,4 +551,7 @@ if test -n "$ODBC_TYPE"; then
PHP_SUBST_OLD(ODBC_TYPE)
PHP_NEW_EXTENSION(odbc, php_odbc.c, $ext_shared,, $ODBC_INCLUDE)
else
AC_MSG_CHECKING([for any ODBC driver support])
AC_MSG_RESULT(no)
fi
+7 -1
View File
@@ -2,6 +2,7 @@
// vim:ft=javascript
ARG_ENABLE("odbc", "ODBC support", "yes");
ARG_WITH("odbcver", "Force support for the passed ODBC version. A hex number is expected, default 0x0300. Use the special value of 0 to prevent an explicit ODBCVER to be defined.", "0x0300");
if (PHP_ODBC == "yes") {
if (CHECK_LIB("odbc32.lib", "odbc") && CHECK_LIB("odbccp32.lib", "odbc")
@@ -9,8 +10,13 @@ if (PHP_ODBC == "yes") {
&& CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
EXTENSION("odbc", "php_odbc.c");
AC_DEFINE("HAVE_UODBC", 1, "ODBC support");
if ("no" == PHP_ODBCVER) {
AC_DEFINE("ODBCVER", "0x0300", "The highest supported ODBC version", false);
} else if ("0" != PHP_ODBCVER) {
AC_DEFINE("ODBCVER", PHP_ODBCVER, "The highest supported ODBC version", false);
}
} else {
WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
PHP_ODBC = "no"
}
}
}
-1
View File
@@ -24,7 +24,6 @@
#define PHP_ODBC_H
#if HAVE_UODBC
#define ODBCVER 0x0250
#ifdef ZTS
#include "TSRM.h"
-6
View File
@@ -25,12 +25,6 @@
#if HAVE_UODBC
#define ODBCVER 0x0250
/*#ifndef MSVC5
#define FAR
#endif
*/
/* checking in the same order as in configure.in */
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) /* Solid Server */
+2 -2
View File
@@ -82,10 +82,10 @@ static void optimize_func_calls(zend_op_array *op_array, zend_persistent_script
case ZEND_FETCH_DIM_FUNC_ARG:
if (call_stack[call - 1].func) {
if (ARG_SHOULD_BE_SENT_BY_REF(call_stack[call - 1].func, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
opline->extended_value = 0;
opline->extended_value &= ZEND_FETCH_TYPE_MASK;
opline->opcode -= 9;
} else {
opline->extended_value = 0;
opline->extended_value &= ZEND_FETCH_TYPE_MASK;
opline->opcode -= 12;
}
}
+6 -1
View File
@@ -380,7 +380,12 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
func->type == ZEND_INTERNAL_FUNCTION &&
func->module->type == MODULE_PERSISTENT) {
zval t;
ZVAL_BOOL(&t, 1);
if (Z_STRLEN(ZEND_OP1_LITERAL(opline)) == sizeof("is_callable") - 1 ||
func->handler != ZEND_FN(display_disabled_function)) {
ZVAL_BOOL(&t, 1);
} else {
ZVAL_BOOL(&t, 0);
}
if (replace_var_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
literal_dtor(&ZEND_OP1_LITERAL(opline - 1));
MAKE_NOP((opline - 1));
+75 -13
View File
@@ -269,6 +269,7 @@ static void update_op2_const(zend_op_array *op_array,
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
case ZEND_ADD_ARRAY_ELEMENT:
case ZEND_INIT_ARRAY:
case ZEND_ASSIGN_DIM:
case ZEND_UNSET_DIM:
case ZEND_FETCH_DIM_R:
case ZEND_FETCH_DIM_W:
@@ -331,6 +332,42 @@ static int replace_var_by_const(zend_op_array *op_array,
}
opline->opcode = ZEND_SEND_VAL;
break;
case ZEND_SWITCH_FREE:
case ZEND_CASE: {
zend_op *m, *n;
int brk = op_array->last_brk_cont;
while (brk--) {
if (op_array->brk_cont_array[brk].start <= (opline - op_array->opcodes) &&
op_array->brk_cont_array[brk].brk > (opline - op_array->opcodes)) {
break;
}
}
m = opline;
n = op_array->opcodes + op_array->brk_cont_array[brk].brk + 1;
while (m < n) {
if (ZEND_OP1_TYPE(m) == IS_VAR &&
ZEND_OP1(m).var == var) {
if (m->opcode == ZEND_CASE) {
zval old_val;
old_val = *val;
zval_copy_ctor(val);
update_op1_const(op_array, m, val TSRMLS_CC);
*val = old_val;
} else if (m->opcode == ZEND_SWITCH_FREE) {
MAKE_NOP(m);
} else {
ZEND_ASSERT(0);
}
}
m++;
}
zval_dtor(val);
return 1;
}
case ZEND_FREE:
MAKE_NOP(opline);
zval_dtor(val);
break;
default:
break;
}
@@ -373,18 +410,47 @@ static void replace_tmp_by_const(zend_op_array *op_array,
* and allows its reuse. The number of ZEND_CASE instructions
* usually terminated by ZEND_FREE that finally kills the value.
*/
if (opline->opcode == ZEND_CASE) {
zval old_val;
old_val = *val;
zval_copy_ctor(val);
update_op1_const(op_array, opline, val TSRMLS_CC);
*val = old_val;
} else if (opline->opcode == ZEND_FREE) {
MAKE_NOP(opline);
if (opline->opcode == ZEND_CASE || opline->opcode == ZEND_FREE) {
zend_op *m, *n;
int brk = op_array->last_brk_cont;
zend_bool in_switch = 0;
while (brk--) {
if (op_array->brk_cont_array[brk].start <= (opline - op_array->opcodes) &&
op_array->brk_cont_array[brk].brk > (opline - op_array->opcodes)) {
in_switch = 1;
break;
}
}
if (!in_switch) {
MAKE_NOP(opline);
zval_dtor(val);
break;
}
m = opline;
n = op_array->opcodes + op_array->brk_cont_array[brk].brk + 1;
while (m < n) {
if (ZEND_OP1_TYPE(m) == IS_TMP_VAR &&
ZEND_OP1(m).var == var) {
if (m->opcode == ZEND_CASE) {
zval old_val;
old_val = *val;
zval_copy_ctor(val);
update_op1_const(op_array, m, val TSRMLS_CC);
*val = old_val;
} else if (m->opcode == ZEND_FREE) {
MAKE_NOP(m);
} else {
ZEND_ASSERT(0);
}
}
m++;
}
zval_dtor(val);
break;
} else {
update_op1_const(op_array, opline, val TSRMLS_CC);
val = NULL;
break;
}
}
@@ -394,14 +460,10 @@ static void replace_tmp_by_const(zend_op_array *op_array,
update_op2_const(op_array, opline, val TSRMLS_CC);
/* TMP_VAR may be used only once */
val = NULL;
break;
}
opline++;
}
if (val) {
zval_dtor(val);
}
}
#include "Optimizer/nop_removal.c"
+2 -19
View File
@@ -582,7 +582,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
ZCSG(force_restart_time) = 0;
while (mem_usage_check->l_pid > 0) {
while (tries--) {
zend_accel_error(ACCEL_LOG_INFO, "Killed locker %d", mem_usage_check->l_pid);
zend_accel_error(ACCEL_LOG_ERROR, "Killed locker %d", mem_usage_check->l_pid);
if (kill(mem_usage_check->l_pid, SIGKILL)) {
break;
}
@@ -595,7 +595,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
usleep(10000);
}
if (!tries) {
zend_accel_error(ACCEL_LOG_INFO, "Can't kill %d after 20 tries!", mem_usage_check->l_pid);
zend_accel_error(ACCEL_LOG_ERROR, "Can't kill %d after 20 tries!", mem_usage_check->l_pid);
ZCSG(force_restart_time) = time(NULL); /* restore forced restart request */
}
@@ -1336,23 +1336,6 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
return NULL;
}
#if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO
if (file_handle->type == ZEND_HANDLE_STREAM &&
(!strstr(file_handle->filename, ".phar") ||
strstr(file_handle->filename, "://"))) {
char *buf;
size_t size;
/* Stream callbacks needs to be called in context of original
* function and class tables (see: https://bugs.php.net/bug.php?id=64353)
*/
if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
*op_array_p = NULL;
return NULL;
}
}
#endif
if (ZCG(accel_directives).validate_timestamps ||
ZCG(accel_directives).file_update_protection ||
ZCG(accel_directives).max_file_size > 0) {
+65
View File
@@ -0,0 +1,65 @@
--TEST--
Bug #69038 (switch(SOMECONSTANT) misbehaves)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function a($a = "bad") {
switch (PHP_OS) {
case "LALALALA" : return "LALALAL";
case PHP_OS: return "okey";
default: break;
}
return $a;
}
var_dump(a());
function b($b = "bad") {
switch (PHP_OS) {
case "LALALAL": return "bad";
case PHP_OS:
switch (PHP_OS) {
case "FOO": break;
case PHP_OS: return "okey";
default :
break;
}
break;
default:
break;
}
return $b;
}
var_dump(b());
function c($b = "bad") {
switch (extension_loaded("standard")) {
case 0 : return "LALALAL";
case 1 : return "okey";
default : return "bad";
}
}
var_dump(c());
function d() {
switch (PHP_OS) {
default: return "bad";
case PHP_OS: return "okey";
}
}
var_dump(d());
?>
--EXPECT--
string(4) "okey"
string(4) "okey"
string(4) "okey"
string(4) "okey"
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #69125 (Array numeric string as key)
--INI--
opcache.enable=1
opcache.enable_cli=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
const SZERO = '0';
const SONE = '1';
$array[SZERO] = "okey";
$array[1] = "okey";
var_dump($array[SZERO]);
var_dump($array[SONE]);
?>
--EXPECT--
string(4) "okey"
string(4) "okey"
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #69159 (Opcache causes problem when passing a variable variable to a function)
--INI--
opcache.enable=1
opcache.optimization_level=-1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$i = 1;
$x1 = "okey";
myFunction(${"x$i"});
function myFunction($x) {
var_dump($x);
}
?>
--EXPECT--
string(4) "okey"
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Test that script cached info is correct with validate_timestamps disabled
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.validate_timestamps=0
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
var_dump(opcache_is_script_cached(__FILE__));
var_dump(opcache_is_script_cached("nonexistent.php"));
?>
--EXPECT--
bool(true)
bool(false)
+1
View File
@@ -4,6 +4,7 @@ Test that script cached info is correct
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.validate_timestamps=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
+4 -2
View File
@@ -324,14 +324,16 @@ static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
persistent_script = zend_accel_hash_find(&ZCSG(hash), filename, filename_len + 1);
if (persistent_script) {
return !persistent_script->corrupted &&
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
(!ZCG(accel_directives).validate_timestamps ||
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS);
}
}
if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC)) != NULL) {
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length + 1);
return persistent_script && !persistent_script->corrupted &&
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
(!ZCG(accel_directives).validate_timestamps ||
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS);
}
return 0;
+1 -1
View File
@@ -346,10 +346,10 @@ void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source TSRML
retval = ZCG(mem);;
ZCG(mem) = (void*)(((char*)ZCG(mem)) + ZEND_ALIGNED_SIZE(size));
memcpy(retval, source, size);
zend_shared_alloc_register_xlat_entry(source, retval);
if (free_source) {
interned_efree((char*)source);
}
zend_shared_alloc_register_xlat_entry(source, retval);
return retval;
}
+1 -1
View File
@@ -91,7 +91,7 @@ typedef struct _handler_entry {
typedef struct _zend_shared_memory_state {
int *positions; /* current positions for each segment */
int shared_free; /* amount of free shared memory */
size_t shared_free; /* amount of free shared memory */
} zend_shared_memory_state;
typedef struct _zend_smm_shared_globals {
+1
View File
@@ -21,6 +21,7 @@ if test "$PHP_OPENSSL" != "no"; then
AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later]))
AC_CHECK_LIB(crypto, X509_free, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later]))
AC_CHECK_FUNCS([RAND_egd])
PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD,
[
+11 -8
View File
@@ -975,11 +975,13 @@ static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *se
if (file == NULL) {
file = RAND_file_name(buffer, sizeof(buffer));
#ifdef HAVE_RAND_EGD
} else if (RAND_egd(file) > 0) {
/* if the given filename is an EGD socket, don't
* write anything back to it */
*egdsocket = 1;
return SUCCESS;
#endif
}
if (file == NULL || !RAND_load_file(file, -1)) {
if (RAND_status() == 0) {
@@ -1532,7 +1534,7 @@ cleanup:
efree(spkstr);
}
if (strlen(s) <= 0) {
if (s && strlen(s) <= 0) {
RETVAL_FALSE;
}
@@ -1927,7 +1929,7 @@ PHP_FUNCTION(openssl_x509_parse)
zval ** zcert;
X509 * cert = NULL;
long certresource = -1;
int i;
int i, sig_nid;
zend_bool useshortnames = 1;
char * tmpstr;
zval * subitem;
@@ -1974,11 +1976,12 @@ PHP_FUNCTION(openssl_x509_parse)
if (tmpstr) {
add_assoc_string(return_value, "alias", tmpstr, 1);
}
/*
add_assoc_long(return_value, "signaturetypeLONG", X509_get_signature_type(cert));
add_assoc_string(return_value, "signaturetype", OBJ_nid2sn(X509_get_signature_type(cert)), 1);
add_assoc_string(return_value, "signaturetypeLN", OBJ_nid2ln(X509_get_signature_type(cert)), 1);
*/
sig_nid = OBJ_obj2nid((cert)->sig_alg->algorithm);
add_assoc_string(return_value, "signatureTypeSN", (char*)OBJ_nid2sn(sig_nid), 1);
add_assoc_string(return_value, "signatureTypeLN", (char*)OBJ_nid2ln(sig_nid), 1);
add_assoc_long(return_value, "signatureTypeNID", sig_nid);
MAKE_STD_ZVAL(subitem);
array_init(subitem);
@@ -4278,7 +4281,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
char * outfilename; int outfilename_len;
char * extracertsfilename = NULL; int extracertsfilename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZZa!|lp",
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZZa!|lp!",
&infilename, &infilename_len, &outfilename, &outfilename_len,
&zcert, &zprivkey, &zheaders, &flags, &extracertsfilename,
&extracertsfilename_len) == FAILURE) {
+9 -38
View File
@@ -8,50 +8,21 @@ if (!defined('OPENSSL_KEYTYPE_EC')) die("skip no EC available");
--FILE--
<?php
$cert = file_get_contents(__DIR__.'/bug64802.pem');
$r = openssl_x509_parse($cert,$use_short_names=true);
sort($r['subject']);
var_dump( $r['subject'] );
$r = openssl_x509_parse($cert,$use_short_names=false);
var_dump($r['subject']['commonName']);
?>
--EXPECTF--
array(11) {
array(6) {
[0]=>
string(14) "1550 Bryant st"
string(9) "www.rd.io"
[1]=>
string(5) "94103"
string(8) "rdio.com"
[2]=>
string(7) "4586007"
string(5) "rd.io"
[3]=>
string(2) "CA"
string(12) "api.rdio.com"
[4]=>
string(26) "COMODO EV Multi-Domain SSL"
string(9) "api.rd.io"
[5]=>
string(20) "Private Organization"
[6]=>
string(10) "Rdio, Inc."
[7]=>
string(13) "San Francisco"
[8]=>
string(2) "US"
[9]=>
array(2) {
[0]=>
string(2) "US"
[1]=>
string(8) "Delaware"
}
[10]=>
array(6) {
[0]=>
string(9) "www.rd.io"
[1]=>
string(8) "rdio.com"
[2]=>
string(5) "rd.io"
[3]=>
string(12) "api.rdio.com"
[4]=>
string(9) "api.rd.io"
[5]=>
string(12) "www.rdio.com"
}
string(12) "www.rdio.com"
}
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #67403: Add signatureType to openssl_x509_parse
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
--FILE--
<?php
$r = openssl_x509_parse(file_get_contents(__DIR__.'/bug64802.pem'));
var_dump($r['signatureTypeSN']);
var_dump($r['signatureTypeLN']);
var_dump($r['signatureTypeNID']);
$r = openssl_x509_parse(file_get_contents(__DIR__.'/bug37820cert.pem'));
var_dump($r['signatureTypeSN']);
var_dump($r['signatureTypeLN']);
var_dump($r['signatureTypeNID']);
--EXPECTF--
string(8) "RSA-SHA1"
string(21) "sha1WithRSAEncryption"
int(65)
string(7) "RSA-MD5"
string(20) "md5WithRSAEncryption"
int(8)
+33
View File
@@ -0,0 +1,33 @@
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIuw/AFD7RWcMCAggA
MBQGCCqGSIb3DQMHBAh98F6GmaGn1ASCAoBpzaFxyttEhyh4dhMjarJIqTz24DjO
yZnp1K5qthejSYx2P28uUsh+gQOh6F2jbVAq++eAWkTBGuc4pWhhoT7nY8vhf0Y0
6yTlVrTxuI/8MNo/lfa0xE/+ZD4B5zp0hQxfij4GTd8l6V/kpXMgiYD1JmIXArm7
sucn+9XV3RucsTBpeIJ1nLEDfpbyEWqNfhoyskQ+S3I6HkMgELI9JpsO6OR9fh1Q
ttdoYxBU+YjoDYcSWRGkTGrJFeGGhTQzz+L2ijgoqNWDSfrLBoQR1bqNVUuw6gcE
9PpA/vpRlxcHbUNNkOWft+4e0tV3I2EqscEcsYeNbd2Ta4yu7f6pk4/Kxn40wrQ8
6Ss9GZylghaFth2xppL/vpmGaCC7FqpZRh+NKqjlcBobIkwyRcsQrPHB0CYLPHA4
yak/dNTY8L5K8Rtd5XG3+E41CoDF6ssNY0Kw7l9kAn/neDVh+WnQkWIiWPmq210a
p4L/uiXRK7aYi+UqKJ5+svayNw2w1dkqpbeejwLq2F1+ek/447JFPVJcvP8Nm7sr
04Mcg+ZHusZdjiWEv4W6CBq8o6eF2JdhfpSDgPkHwiZ/EarHfx0vcYIMJhlEQBmk
a/XsZPk2wnamKSPfJautO3MIus0M6SniWF6eDA4/AZzSjXV8Vc0unb6lc+Nc8tJa
6MU1soTsmki/YraCmQswqpL+kXFZVeHuLowOC5oH+CimQoscmiZ9tBvpnYo6XwEZ
S9jZRIBQ77oMku+rlMPfz2FURgVXZpEfrGmxKvA5Vt3ojrYfTwwD2YqZHVcm39zy
iKqA1qVt7A2A90ILMAzYnN0VRE4SO3yIDN1ZBp5OOY61AduPrhpaHl81
-----END ENCRYPTED PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIICdjCCAd+gAwIBAgIJAPbIVRT31Al2MA0GCSqGSIb3DQEBCwUAMFgxCzAJBgNV
BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
Q29tcGFueSBMdGQxFDASBgNVBAMMC3BocCB0ZXN0IGNhMB4XDTE1MDMwNTA2MTYz
MFoXDTI1MDMwMjA2MTYzMFowUjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlNDMRUw
EwYDVQQHDAxNeXJ0bGUgQmVhY2gxDDAKBgNVBAsMA1BIUDERMA8GA1UEAwwIdGVz
dC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKp5gxUbKvY5eFwZJti0
6d6YBo400Or6M+bLfIMnz5C1WQ7dMfiQpeFLpSIlOIaFqyrqkeeR9k5dsx1K9FOu
PAJ4+lmWA4R93RpdJFz8kmQoNu3P59JMATXi8wvNBIrN/Vc08NT0wBRImeyQSVHd
UcFIXBEbBM0dQsPKQ1k8n5WDAgMBAAGjTjBMMAkGA1UdEwQCMAAwCwYDVR0PBAQD
AgXgMDIGA1UdEQQrMCmCEmRlYnMuYWstb25saW5lLmJlLoITZGVicy5hay1vbmxp
bmUubmV0LjANBgkqhkiG9w0BAQsFAAOBgQB8PaLt+IX690UIbHKuko4qAdc5SzWA
Vbm3D4StZeFwWQbZbBGFCDn0/0ON0iDv4JUgZnaX84mBDPczN26QG2PJND0Cggmi
umylEVYhclPF4RoGcoKd3jT2igzDNyzk/lu+NUtRv/Nj161ds9vb9XiOrEkPn8Ne
mzz3wA0D5A65lw==
-----END CERTIFICATE-----
+41
View File
@@ -0,0 +1,41 @@
--TEST--
Bug #68265: SAN match fails with trailing DNS dot
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (!function_exists("proc_open")) die("skip no proc_open");
--FILE--
<?php
$serverCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
$serverCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/bug68265.pem',
'passphrase' => 'elephpant',
]]);
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
phpt_notify();
stream_socket_accept($server, 30);
CODE;
$clientCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$clientFlags = STREAM_CLIENT_CONNECT;
$clientCtx = stream_context_create(['ssl' => [
'verify_peer' => false,
'verify_peer_name' => true,
'peer_name' => 'debs.ak-online.net',
]]);
phpt_wait();
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
CODE;
include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
--EXPECTF--
resource(%d) of type (stream)
+33
View File
@@ -0,0 +1,33 @@
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIuw/AFD7RWcMCAggA
MBQGCCqGSIb3DQMHBAh98F6GmaGn1ASCAoBpzaFxyttEhyh4dhMjarJIqTz24DjO
yZnp1K5qthejSYx2P28uUsh+gQOh6F2jbVAq++eAWkTBGuc4pWhhoT7nY8vhf0Y0
6yTlVrTxuI/8MNo/lfa0xE/+ZD4B5zp0hQxfij4GTd8l6V/kpXMgiYD1JmIXArm7
sucn+9XV3RucsTBpeIJ1nLEDfpbyEWqNfhoyskQ+S3I6HkMgELI9JpsO6OR9fh1Q
ttdoYxBU+YjoDYcSWRGkTGrJFeGGhTQzz+L2ijgoqNWDSfrLBoQR1bqNVUuw6gcE
9PpA/vpRlxcHbUNNkOWft+4e0tV3I2EqscEcsYeNbd2Ta4yu7f6pk4/Kxn40wrQ8
6Ss9GZylghaFth2xppL/vpmGaCC7FqpZRh+NKqjlcBobIkwyRcsQrPHB0CYLPHA4
yak/dNTY8L5K8Rtd5XG3+E41CoDF6ssNY0Kw7l9kAn/neDVh+WnQkWIiWPmq210a
p4L/uiXRK7aYi+UqKJ5+svayNw2w1dkqpbeejwLq2F1+ek/447JFPVJcvP8Nm7sr
04Mcg+ZHusZdjiWEv4W6CBq8o6eF2JdhfpSDgPkHwiZ/EarHfx0vcYIMJhlEQBmk
a/XsZPk2wnamKSPfJautO3MIus0M6SniWF6eDA4/AZzSjXV8Vc0unb6lc+Nc8tJa
6MU1soTsmki/YraCmQswqpL+kXFZVeHuLowOC5oH+CimQoscmiZ9tBvpnYo6XwEZ
S9jZRIBQ77oMku+rlMPfz2FURgVXZpEfrGmxKvA5Vt3ojrYfTwwD2YqZHVcm39zy
iKqA1qVt7A2A90ILMAzYnN0VRE4SO3yIDN1ZBp5OOY61AduPrhpaHl81
-----END ENCRYPTED PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIICkTCCAfqgAwIBAgIJAPbIVRT31Al1MA0GCSqGSIb3DQEBCwUAMFgxCzAJBgNV
BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
Q29tcGFueSBMdGQxFDASBgNVBAMMC3BocCB0ZXN0IGNhMB4XDTE1MDMwNTA0NTQx
NVoXDTI1MDMwMjA0NTQxNVowUjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlNDMRUw
EwYDVQQHDAxNeXJ0bGUgQmVhY2gxDDAKBgNVBAsMA1BIUDERMA8GA1UEAwwIdGVz
dC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKp5gxUbKvY5eFwZJti0
6d6YBo400Or6M+bLfIMnz5C1WQ7dMfiQpeFLpSIlOIaFqyrqkeeR9k5dsx1K9FOu
PAJ4+lmWA4R93RpdJFz8kmQoNu3P59JMATXi8wvNBIrN/Vc08NT0wBRImeyQSVHd
UcFIXBEbBM0dQsPKQ1k8n5WDAgMBAAGjaTBnMAkGA1UdEwQCMAAwCwYDVR0PBAQD
AgXgME0GA1UdEQRGMESCCHRlc3QuY29tggx3d3cudGVzdC5jb22CEnN1YmRvbWFp
bi50ZXN0LmNvbYcQAAAAAAAAAAAAAP//CgIAAYcECgIAATANBgkqhkiG9w0BAQsF
AAOBgQBZ4TptNXV85gNj3wcB5feWFcwKO8cN4hwnhrbqiHN280r9O/g1CQiLmB4K
2txrJt06UNCnvWse7CdvsN14wu6rRGRk/+7M36NBw5ERkAzp5HXgZUWVdMl3YltB
PpqbLhGGrkVn7/jW2FdAxfax7qaGDYgC3qcQNfiK6K92SPxV7Q==
-----END CERTIFICATE-----
+41
View File
@@ -0,0 +1,41 @@
--TEST--
Bug #68879: Match IP address fields in subjectAltName checks
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (!function_exists("proc_open")) die("skip no proc_open");
--FILE--
<?php
$serverCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
$serverCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/bug68879.pem',
'passphrase' => 'elephpant',
]]);
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
phpt_notify();
stream_socket_accept($server, 30);
CODE;
$clientCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$clientFlags = STREAM_CLIENT_CONNECT;
$clientCtx = stream_context_create(['ssl' => [
'verify_peer' => false,
'verify_peer_name' => true,
'peer_name' => '10.2.0.1',
]]);
phpt_wait();
var_dump(stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $clientCtx));
CODE;
include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
--EXPECTF--
resource(%d) of type (stream)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #68912 (Segmentation fault at openssl_spki_new)
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
if (!@openssl_pkey_new()) die("skip cannot create private key");
?>
--FILE--
<?php
$var1=xml_parser_create_ns();
$var2=2;
$var3=3;
openssl_spki_new($var1, $var2, $var3);
?>
--EXPECTF--
Warning: openssl_spki_new(): supplied resource is not a valid OpenSSL X.509/key resource in %sbug68912.php on line %d
Warning: openssl_spki_new(): Unable to use supplied private key in %sbug68912.php on line %d
+81
View File
@@ -0,0 +1,81 @@
--TEST--
Bug #68920: peer_fingerprint input checks should be strict
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (!function_exists("proc_open")) die("skip no proc_open");
--FILE--
<?php
$serverCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
$serverCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/san-cert.pem',
]]);
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
phpt_notify();
stream_socket_accept($server, 30);
stream_socket_accept($server, 30);
stream_socket_accept($server, 30);
stream_socket_accept($server, 30);
CODE;
$clientCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$clientFlags = STREAM_CLIENT_CONNECT;
phpt_wait();
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => true]]);
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
var_dump($sock);
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => null]]);
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
var_dump($sock);
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => []]]);
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
var_dump($sock);
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => ['foo']]]);
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
var_dump($sock);
CODE;
include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
--EXPECTF--
Warning: stream_socket_client(): Expected peer fingerprint must be a string or an array in %s on line %d
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
bool(false)
Warning: stream_socket_client(): Expected peer fingerprint must be a string or an array in %s on line %d
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
bool(false)
Warning: stream_socket_client(): Invalid peer_fingerprint array; [algo => fingerprint] form required in %s on line %d
Warning: stream_socket_client(): peer_fingerprint match failure in %s on line %d
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
bool(false)
Warning: stream_socket_client(): Invalid peer_fingerprint array; [algo => fingerprint] form required in %s on line %d
Warning: stream_socket_client(): peer_fingerprint match failure in %s on line %d
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
bool(false)
+16
View File
@@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE-----
MIICfjCCAeegAwIBAgIJAMO7Amv3ZHJBMA0GCSqGSIb3DQEBCwUAMFgxCzAJBgNV
BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
Q29tcGFueSBMdGQxFDASBgNVBAMMC3BocCB0ZXN0IGNhMB4XDTE1MDMwMzE3NTQz
OVoXDTI1MDIyODE3NTQzOVowWDELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1
bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDEUMBIGA1UEAwwL
cGhwIHRlc3QgY2EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKac+r8AzEEk
Cdnue7nx3gxmsXTYzwnywjjGJSknoWCdNEE+LqtT8RU0J+V76w4ehWRnhLVtu//v
3InsrpcniGfTcov60NelHQOfn5XCCV5zqVi628WddwwdVw4AI58K3YrNk450VCBu
dMy6m2Tm+dQwgVbtR+nIwzfm47CMWW2DAgMBAAGjUDBOMB0GA1UdDgQWBBTtMxRr
plep4RW3PjhosYsIdIoMojAfBgNVHSMEGDAWgBTtMxRrplep4RW3PjhosYsIdIoM
ojAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBADMF2pL8jCF6PFPhMuFN
zxoLSuy6uLAkjkujo5e33kSUW5MI4jT/aoL2hnBPA4uJPC/TZXoBHKBpnPES2GkJ
r7tOR51Jsk7HRTdvOMkcdD9Fe+M+Q5rOMUlCtyX/SRhc1uFnC2//Y/rx4Tc8djGl
RqrH/Oi38u1083krmNRQNw/Z
-----END CERTIFICATE-----
+32
View File
@@ -0,0 +1,32 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,CE3DEB59F7DF7AF4
9REujZuwDkwoN949Gw77c3aJiQvwoPiUXJ+cDirn4ii56OsHBSCWfCe4Mqn976GK
9IAPwHJ5yRewPpFvb+xRqtMtnm8S7HIfVtZqW4FkG+g/paEg6rwqVpW78Jco/gww
6XFGrmU1bwKWrB05YV1BWnbB4L7Q+/U0ZcNvdNISOBW//2HuHeKVWe1DKoaRtoVz
v4BFQxr7F3A9tm3vz9Jn2JreVrihdWQVlVTVOsfiQk/yPVA7twxiT2Hfimp/gFSX
l28rA+jB7xd6IhpA/EXAYnCbxSp9kSXYtba26dO3rQHlgRv1a38AwvCD/3igQzF/
XjetX2a75ITi5c7bUT4ZpVX8ZPU8oVBqSo6MXisFWBT0Svx+KhWyyn2V0z66APdR
X1V6dZiAcqN7giRg3Yj/lMDo0nV4Ph+Ce7p3Mv/p4qU0mxf7O8sPhp7DloHQFEF0
HyooNp26YT4V47NDxwIlkoj9YZ5nkO/svQ1qxiTKWNUdfWw5r3lFiAw5xTyDDiBs
Sz776DaFo3Ss3JSUr5RLe4rEEc02iVqYB9OPXoUaUwS+//1KKgzF3xq/yxsJM5dR
ljphraCViZzJPw4z69Lmao9CPRfDxKChVOSLkKgmFIOeronLdTypieanc3/o002c
2ecb/x9f7G2XAn0iwcfylMkSZHirxqaos8LodsPxg8GdNJT89C66n+EJerrFwi6i
qT0EvNfkbxYd3zj82+j1weNFLsQuB0O1UJBWEdyj74gIX+4HkZpSYLQ2O8MTz3yE
52JcRRyl9ECdNJw15jkDQIusUreYMHb7YW+u+3+ci21H94Iay5XSYw==
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIICKDCCAZECCQD2yFUU99QJdzANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJY
WDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZhdWx0IENvbXBh
bnkgTHRkMRQwEgYDVQQDDAtwaHAgdGVzdCBjYTAeFw0xNTAzMTAyMzM0MDNaFw0y
NTAzMDcyMzM0MDNaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJTQzEVMBMGA1UE
BwwMTXlydGxlIEJlYWNoMQwwCgYDVQQLDANQSFAxGDAWBgNVBAMMD2J1ZzY5MjE1
LWNsaWVudDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyLTbIGryqx0wGDD+
xdrJsrcwXFyTYpCOHUaxl1wt/6j6u7yW5m4TJFEDUtIGnqBGYiPE9iynkLkOwUF/
IpheONJENIjXkdSJPUEy/Ggz9WOa0qO6dQZU44NpGO7LFW97HglBIsbhioOsdcf/
INAgidoMJNizkuTBNRGW7iKp0lsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQBKkZLQ
aU12/cPvW5e9AXArnE9jxMhnzuCKy81eHj30CC/nHpId9i5YZytHcZEZyEOWE6DQ
IsqmsP5ZheXq26mUtHOcEdEgcqcXTRotKXFwIxTZxP5jkCRn0xGbeHh7H9pg6TP0
QekWTkWCh5qcf3NXvJtk4TCfLC6FSjehHkq9yQ==
-----END CERTIFICATE-----
+32
View File
@@ -0,0 +1,32 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,4C7155D678EDABFA
NdOGB8UpC5xrnCFIOzxV6s4y4PZlxgX8s+iL/JeGVmS7a8pDSTzbb6wjauYy3n/2
KCywHsFdAjifi8SGHJOJBVep3GS7dWw979vWdiKjQEAlJpoouv6P58Xpn4jDf1uX
ZrpmSTXI0iH7HYE2pzrkxPbg0Cz5GV2d2VlL7U5d4+UxXh8fSBndgHligmoc8mCU
1AG7ZmvPhMDTewhR333qKBYi9TBZuw75Crpy5CjPO30vBMfZpseOvtEnmI0JYGwe
75Q3e6sgY0o9b7Q42+g9v+FpGBTHhmldwYD7k1TtOC/PT4eO68E3mDawR2v+X9r8
4jL22d3tB4Q4qAfBwbR37umTaQHLIxtjzc2OjXb/Ju35LW9d0hEuaAQK3oY8yeEi
gctYWrCN4K+cxZQwq1+ulpkHXULGs9QxXT9KJYfV1+HWkauWUSycFhA74jWW0mL5
InlGaFf6oiRrP4lgRVXD3rtTLCwkCD2JcvTbF+re9+vCpui7zPW2peGwcE/W7TiK
wHFJhQQyYGcAWsal7ekXshTLoz4jeaPgak7dg50ZjjwcWr0bJuJ3RRaocMhYZ6Bd
DiF30nCijVSJfrLhugN2RJmSysT4WNXn5qaDGEOhVgkXZscZ3ClFGsMnxAz9sqbJ
J+ZMbqxkwSIf/+dPfhnjOWm3HPpP3T9wioYZT7KuI98pfGnHMZmX5CaJ6d/uBO5G
8jMvQLWOx+1WoDfWDkn7SfNDyTg4/dEo5IJFXv2S9zSPynCnQcBkYUevIfJ7vDo/
7pXCkcY+C1zssW8R1J+WNbHI1syzVbvSg6hlgyEPXuDbErCRqiFm1g==
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIICKDCCAZECCQD2yFUU99QJeDANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJY
WDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZhdWx0IENvbXBh
bnkgTHRkMRQwEgYDVQQDDAtwaHAgdGVzdCBjYTAeFw0xNTAzMTAyMzM1MjFaFw0y
NTAzMDcyMzM1MjFaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJTQzEVMBMGA1UE
BwwMTXlydGxlIEJlYWNoMQwwCgYDVQQLDANQSFAxGDAWBgNVBAMMD2J1ZzY5MjE1
LXNlcnZlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAup0kaIwQufxQWXmE
QWbd7yxMQ69UHRhbb2stAo7qxmYMeH3bWCaR/oAPOswjtkXZQgyj0slLAWJDXKDg
zCnEKsU2yWLnvQy/h1rq/kBIybMoLKMIkRZQtrGcApKJtyrq8OtTz6odKQ7k9hym
DtPF+2lcVhSAd+qjngF3txrVKjsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCfXuL4
TODLV54uKKVdVGwr8U3EQ3JdYOqN3Hr9kpmxe6StIcLxQ1e+mSDgKcixzw6CXN3P
f++8NugAt4Ja2SDqqw1gzrX+9u6KZpnMKpEDIK0Z3Ss51ZwqilAXmFVybNTyYeVo
HweM1IY/zrBpSTQv/aKs1R2Pyb0Heindnp0PUQ==
-----END CERTIFICATE-----
+48
View File
@@ -0,0 +1,48 @@
--TEST--
Bug #69215: Crypto servers should send client CA list
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (!function_exists("proc_open")) die("skip no proc_open");
--FILE--
<?php
$serverCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
$serverCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/bug69215-server.pem',
'passphrase' => 'elephpant',
'cafile' => __DIR__ . '/bug69215-ca.pem',
'verify_peer' => true,
'verify_peer_name' => true,
'peer_name' => 'bug69215-client',
]]);
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
phpt_notify();
stream_socket_accept($server, 30);
CODE;
$clientCode = <<<'CODE'
$serverUri = "ssl://127.0.0.1:64321";
$clientFlags = STREAM_CLIENT_CONNECT;
$clientCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/bug69215-client.pem',
'passphrase' => 'elephpant',
'cafile' => __DIR__ . '/bug69215-ca.pem',
'verify_peer' => true,
'verify_peer_name' => true,
'peer_name' => 'bug69215-server',
]]);
phpt_wait();
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
CODE;
include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
--EXPECTF--
resource(%d) of type (stream)
@@ -45,7 +45,7 @@ CODE;
include 'ServerClientTestCase.inc';
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
--EXPECTF--
Warning: stream_socket_client(): Peer fingerprint doesn't match in %s on line %d
Warning: stream_socket_client(): peer_fingerprint match failure in %s on line %d
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
@@ -12,7 +12,7 @@ var_dump(openssl_x509_parse($cert));
var_dump(openssl_x509_parse($cert, false));
?>
--EXPECTF--
array(12) {
array(15) {
["name"]=>
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
["subject"]=>
@@ -55,6 +55,12 @@ array(12) {
int(1214821723)
["validTo_time_t"]=>
int(1217413723)
["signatureTypeSN"]=>
string(8) "RSA-SHA1"
["signatureTypeLN"]=>
string(21) "sha1WithRSAEncryption"
["signatureTypeNID"]=>
int(65)
["purposes"]=>
array(9) {
[1]=>
@@ -152,7 +158,7 @@ serial:AE:C5:56:CC:72:37:50:A2
string(7) "CA:TRUE"
}
}
array(12) {
array(15) {
["name"]=>
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
["subject"]=>
@@ -195,6 +201,12 @@ array(12) {
int(1214821723)
["validTo_time_t"]=>
int(1217413723)
["signatureTypeSN"]=>
string(8) "RSA-SHA1"
["signatureTypeLN"]=>
string(21) "sha1WithRSAEncryption"
["signatureTypeNID"]=>
int(65)
["purposes"]=>
array(9) {
[1]=>
+259 -99
View File
@@ -78,6 +78,9 @@ extern php_stream* php_openssl_get_stream_from_ssl_handle(const SSL *ssl);
extern int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw, char **out, int *out_len TSRMLS_DC);
extern int php_openssl_get_ssl_stream_data_index();
extern int php_openssl_get_x509_list_id(void);
static struct timeval subtract_timeval( struct timeval a, struct timeval b );
static int compare_timeval( struct timeval a, struct timeval b );
static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, size_t count TSRMLS_DC);
php_stream_ops php_openssl_socket_ops;
@@ -272,7 +275,7 @@ static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *
int result = -1;
if (php_openssl_x509_fingerprint(peer, method, 0, &fingerprint, &fingerprint_len TSRMLS_CC) == SUCCESS) {
result = strcmp(expected, fingerprint);
result = strcasecmp(expected, fingerprint);
efree(fingerprint);
}
@@ -295,6 +298,7 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
}
return method && php_x509_fingerprint_cmp(peer, method, Z_STRVAL_P(val) TSRMLS_CC) == 0;
} else if (Z_TYPE_P(val) == IS_ARRAY) {
HashPosition pos;
zval **current;
@@ -302,21 +306,33 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
uint key_len;
ulong key_index;
if (!zend_hash_num_elements(Z_ARRVAL_P(val))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required");
return 0;
}
for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(val), &pos);
zend_hash_get_current_data_ex(Z_ARRVAL_P(val), (void **)&current, &pos) == SUCCESS;
zend_hash_move_forward_ex(Z_ARRVAL_P(val), &pos)
) {
int key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(val), &key, &key_len, &key_index, 0, &pos);
if (key_type == HASH_KEY_IS_STRING
&& Z_TYPE_PP(current) == IS_STRING
&& php_x509_fingerprint_cmp(peer, key, Z_STRVAL_PP(current) TSRMLS_CC) != 0
) {
if (!(key_type == HASH_KEY_IS_STRING && Z_TYPE_PP(current) == IS_STRING)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required");
return 0;
}
if (php_x509_fingerprint_cmp(peer, key, Z_STRVAL_PP(current) TSRMLS_CC) != 0) {
return 0;
}
}
return 1;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Invalid peer_fingerprint value; fingerprint string or array of the form [algo => fingerprint] required");
}
return 0;
}
@@ -354,40 +370,57 @@ static zend_bool matches_wildcard_name(const char *subjectname, const char *cert
}
/* }}} */
static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC) /* {{{ */
static zend_bool matches_san_list(X509 *peer, const char *subject_name) /* {{{ */
{
int i, san_name_len;
zend_bool is_match = 0;
int i, len;
unsigned char *cert_name = NULL;
char ipbuffer[64];
GENERAL_NAMES *alt_names = X509_get_ext_d2i(peer, NID_subject_alt_name, 0, 0);
int alt_name_count = sk_GENERAL_NAME_num(alt_names);
for (i = 0; i < alt_name_count; i++) {
GENERAL_NAME *san = sk_GENERAL_NAME_value(alt_names, i);
if (san->type != GEN_DNS) {
/* we only care about DNS names */
continue;
}
san_name_len = ASN1_STRING_length(san->d.dNSName);
ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName);
if (san->type == GEN_DNS) {
ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName);
if (ASN1_STRING_length(san->d.dNSName) != strlen((const char*)cert_name)) {
OPENSSL_free(cert_name);
/* prevent null-byte poisoning*/
continue;
}
/* prevent null byte poisoning */
if (san_name_len != strlen((const char*)cert_name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer SAN entry is malformed");
} else {
is_match = matches_wildcard_name(subject_name, (const char *)cert_name);
}
/* accommodate valid FQDN entries ending in "." */
len = strlen((const char*)cert_name);
if (len && strcmp((const char *)&cert_name[len-1], ".") == 0) {
cert_name[len-1] = '\0';
}
OPENSSL_free(cert_name);
if (is_match) {
break;
if (matches_wildcard_name(subject_name, (const char *)cert_name)) {
OPENSSL_free(cert_name);
return 1;
}
OPENSSL_free(cert_name);
} else if (san->type == GEN_IPADD) {
if (san->d.iPAddress->length == 4) {
sprintf(ipbuffer, "%d.%d.%d.%d",
san->d.iPAddress->data[0],
san->d.iPAddress->data[1],
san->d.iPAddress->data[2],
san->d.iPAddress->data[3]
);
if (strcasecmp(subject_name, (const char*)ipbuffer) == 0) {
return 1;
}
}
/* No, we aren't bothering to check IPv6 addresses. Why?
* Because IP SAN names are officially deprecated and are
* not allowed by CAs starting in 2015. Deal with it.
*/
}
}
return is_match;
return 0;
}
/* }}} */
@@ -436,7 +469,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
? zend_is_true(*val)
: sslsock->is_client;
must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(*val));
must_verify_fingerprint = GET_VER_OPT("peer_fingerprint");
if ((must_verify_peer || must_verify_peer_name || must_verify_fingerprint) && peer == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate");
@@ -471,7 +504,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
if (Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_ARRAY) {
if (!php_x509_fingerprint_match(peer, *val TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Peer fingerprint doesn't match"
"peer_fingerprint match failure"
);
return FAILURE;
}
@@ -479,6 +512,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Expected peer fingerprint must be a string or an array"
);
return FAILURE;
}
}
@@ -498,7 +532,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
}
if (peer_name) {
if (matches_san_list(peer, peer_name TSRMLS_CC)) {
if (matches_san_list(peer, peer_name)) {
return SUCCESS;
} else if (matches_common_name(peer, peer_name TSRMLS_CC)) {
return SUCCESS;
@@ -783,16 +817,26 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
zval **val = NULL;
char *cafile = NULL;
char *capath = NULL;
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
GET_VER_OPT_STRING("cafile", cafile);
GET_VER_OPT_STRING("capath", capath);
if (!cafile) {
if (cafile == NULL) {
cafile = zend_ini_string("openssl.cafile", sizeof("openssl.cafile"), 0);
cafile = strlen(cafile) ? cafile : NULL;
} else if (!sslsock->is_client) {
/* Servers need to load and assign CA names from the cafile */
STACK_OF(X509_NAME) *cert_names = SSL_load_client_CA_file(cafile);
if (cert_names != NULL) {
SSL_CTX_set_client_CA_list(ctx, cert_names);
} else {
php_error(E_WARNING, "SSL: failed loading CA names from cafile");
return FAILURE;
}
}
if (!capath) {
if (capath == NULL) {
capath = zend_ini_string("openssl.capath", sizeof("openssl.capath"), 0);
capath = strlen(capath) ? capath : NULL;
}
@@ -808,9 +852,6 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
SSL_CTX_set_cert_verify_callback(ctx, win_cert_verify_callback, (void *)stream);
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
#else
php_openssl_netstream_data_t *sslsock;
sslsock = (php_openssl_netstream_data_t*)stream->abstract;
if (sslsock->is_client && !SSL_CTX_set_default_verify_paths(ctx)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Unable to set default verify locations and no CA settings specified");
@@ -1679,16 +1720,9 @@ static int php_openssl_enable_crypto(php_stream *stream,
if (has_timeout) {
gettimeofday(&cur_time, NULL);
elapsed_time.tv_sec = cur_time.tv_sec - start_time.tv_sec;
elapsed_time.tv_usec = cur_time.tv_usec - start_time.tv_usec;
if (cur_time.tv_usec < start_time.tv_usec) {
elapsed_time.tv_sec -= 1L;
elapsed_time.tv_usec += 1000000L;
}
elapsed_time = subtract_timeval( cur_time, start_time );
if (elapsed_time.tv_sec > timeout->tv_sec ||
(elapsed_time.tv_sec == timeout->tv_sec &&
elapsed_time.tv_usec > timeout->tv_usec)) {
if (compare_timeval( elapsed_time, *timeout) > 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL: Handshake timed out");
return -1;
}
@@ -1704,12 +1738,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
struct timeval left_time;
if (has_timeout) {
left_time.tv_sec = timeout->tv_sec - elapsed_time.tv_sec;
left_time.tv_usec = timeout->tv_usec - elapsed_time.tv_usec;
if (timeout->tv_usec < elapsed_time.tv_usec) {
left_time.tv_sec -= 1L;
left_time.tv_usec += 1000000L;
}
left_time = subtract_timeval( *timeout, elapsed_time );
}
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_READ) ?
(POLLIN|POLLPRI) : POLLOUT, has_timeout ? &left_time : NULL);
@@ -1774,75 +1803,171 @@ static int php_openssl_enable_crypto(php_stream *stream,
return -1;
}
static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)/* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int didwrite;
if (sslsock->ssl_active) {
int retry = 1;
do {
didwrite = SSL_write(sslsock->ssl_handle, buf, count);
if (didwrite <= 0) {
retry = handle_ssl_error(stream, didwrite, 0 TSRMLS_CC);
} else {
break;
}
} while(retry);
if (didwrite > 0) {
php_stream_notify_progress_increment(stream->context, didwrite, 0);
}
} else {
didwrite = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC);
}
if (didwrite < 0) {
didwrite = 0;
}
return didwrite;
return php_openssl_sockop_io(1, stream, buf, count TSRMLS_CC);
}
/* }}} */
static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
{
return php_openssl_sockop_io(0, stream, (char*)buf, count TSRMLS_CC);
}
/* }}} */
/**
* Factored out common functionality (blocking, timeout, loop management) for read and write.
* Perform IO (read or write) to an SSL socket. If we have a timeout, we switch to non-blocking mode
* for the duration of the operation, using select to do our waits. If we time out, or we have an error
* report that back to PHP
*
*/
static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, size_t count TSRMLS_DC)
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int nr_bytes = 0;
/* Only do this if SSL is active. */
if (sslsock->ssl_active) {
int retry = 1;
struct timeval start_time;
struct timeval *timeout = NULL;
int began_blocked = sslsock->s.is_blocked;
int has_timeout = 0;
/* never use a timeout with non-blocking sockets */
if (began_blocked && &sslsock->s.timeout) {
timeout = &sslsock->s.timeout;
}
if (timeout && php_set_sock_blocking(sslsock->s.socket, 0 TSRMLS_CC) == SUCCESS) {
sslsock->s.is_blocked = 0;
}
if (!sslsock->s.is_blocked && timeout && (timeout->tv_sec || timeout->tv_usec)) {
has_timeout = 1;
/* gettimeofday is not monotonic; using it here is not strictly correct */
gettimeofday(&start_time, NULL);
}
/* Main IO loop. */
do {
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
struct timeval cur_time, elapsed_time, left_time;
/* If we have a timeout to check, figure out how much time has elapsed since we started. */
if (has_timeout) {
gettimeofday(&cur_time, NULL);
if (sslsock->reneg && sslsock->reneg->should_close) {
/* renegotiation rate limiting triggered */
php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR TSRMLS_CC);
nr_bytes = 0;
stream->eof = 1;
break;
} else if (nr_bytes <= 0) {
retry = handle_ssl_error(stream, nr_bytes, 0 TSRMLS_CC);
stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle));
} else {
/* we got the data */
break;
/* Determine how much time we've taken so far. */
elapsed_time = subtract_timeval(cur_time, start_time);
/* and return an error if we've taken too long. */
if (compare_timeval(elapsed_time, *timeout) > 0 ) {
/* If the socket was originally blocking, set it back. */
if (began_blocked) {
php_set_sock_blocking(sslsock->s.socket, 1 TSRMLS_CC);
sslsock->s.is_blocked = 1;
}
sslsock->s.timeout_event = 1;
return -1;
}
}
/* Now, do the IO operation. Don't block if we can't complete... */
if (read) {
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
if (sslsock->reneg && sslsock->reneg->should_close) {
/* renegotiation rate limiting triggered */
php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR TSRMLS_CC);
nr_bytes = 0;
stream->eof = 1;
break;
}
} else {
nr_bytes = SSL_write(sslsock->ssl_handle, buf, count);
}
/* Now, how much time until we time out? */
if (has_timeout) {
left_time = subtract_timeval( *timeout, elapsed_time );
}
/* If we didn't do anything on the last loop (or an error) check to see if we should retry or exit. */
if (nr_bytes <= 0) {
/* Get the error code from SSL, and check to see if it's an error or not. */
int err = SSL_get_error(sslsock->ssl_handle, nr_bytes );
retry = handle_ssl_error(stream, nr_bytes, 0 TSRMLS_CC);
/* If we get this (the above doesn't check) then we'll retry as well. */
if (errno == EAGAIN && err == SSL_ERROR_WANT_READ && read) {
retry = 1;
}
if (errno == EAGAIN && err == SSL_ERROR_WANT_WRITE && read == 0) {
retry = 1;
}
/* Also, on reads, we may get this condition on an EOF. We should check properly. */
if (read) {
stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle));
}
/* Now, if we have to wait some time, and we're supposed to be blocking, wait for the socket to become
* available. Now, php_pollfd_for uses select to wait up to our time_left value only...
*/
if (retry && began_blocked) {
if (read) {
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_WRITE) ?
(POLLOUT|POLLPRI) : (POLLIN|POLLPRI), has_timeout ? &left_time : NULL);
} else {
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_READ) ?
(POLLIN|POLLPRI) : (POLLOUT|POLLPRI), has_timeout ? &left_time : NULL);
}
}
} else {
/* Else, if we got bytes back, check for possible errors. */
int err = SSL_get_error(sslsock->ssl_handle, nr_bytes);
/* If we didn't get any error, then let's return it to PHP. */
if (err == SSL_ERROR_NONE)
break;
/* Otherwise, we need to wait again (up to time_left or we get an error) */
if (began_blocked) {
if (read) {
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_WRITE) ?
(POLLOUT|POLLPRI) : (POLLIN|POLLPRI), has_timeout ? &left_time : NULL);
} else {
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_READ) ?
(POLLIN|POLLPRI) : (POLLOUT|POLLPRI), has_timeout ? &left_time : NULL);
}
}
}
/* Finally, we keep going until we got data, and an SSL_ERROR_NONE, unless we had an error. */
} while (retry);
/* Tell PHP if we read / wrote bytes. */
if (nr_bytes > 0) {
php_stream_notify_progress_increment(stream->context, nr_bytes, 0);
}
}
else
{
nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC);
/* And if we were originally supposed to be blocking, let's reset the socket to that. */
if (began_blocked && php_set_sock_blocking(sslsock->s.socket, 1 TSRMLS_CC) == SUCCESS) {
sslsock->s.is_blocked = 1;
}
} else {
/*
* This block is if we had no timeout... We will just sit and wait forever on the IO operation.
*/
if (read) {
nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC);
} else {
nr_bytes = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC);
}
}
/* PHP doesn't expect a negative return. */
if (nr_bytes < 0) {
nr_bytes = 0;
}
@@ -1851,6 +1976,32 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
}
/* }}} */
struct timeval subtract_timeval( struct timeval a, struct timeval b )
{
struct timeval difference;
difference.tv_sec = a.tv_sec - b.tv_sec;
difference.tv_usec = a.tv_usec - b.tv_usec;
if (a.tv_usec < b.tv_usec) {
b.tv_sec -= 1L;
b.tv_usec += 1000000L;
}
return difference;
}
int compare_timeval( struct timeval a, struct timeval b )
{
if (a.tv_sec > b.tv_sec || (a.tv_sec == b.tv_sec && a.tv_usec > b.tv_usec) ) {
return 1;
} else if( a.tv_sec == b.tv_sec && a.tv_usec == b.tv_usec ) {
return 0;
} else {
return -1;
}
}
static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
@@ -2133,7 +2284,16 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS
case PHP_STREAM_AS_FD_FOR_SELECT:
if (ret) {
*(php_socket_t *)ret = sslsock->s.socket;
size_t pending;
if (stream->writepos == stream->readpos
&& sslsock->ssl_active
&& (pending = (size_t)SSL_pending(sslsock->ssl_handle)) > 0) {
php_stream_fill_read_buffer(stream, pending < stream->chunk_size
? pending
: stream->chunk_size);
}
*(int *)ret = sslsock->s.socket;
}
return SUCCESS;
@@ -2168,7 +2328,7 @@ static long get_crypto_method(php_stream_context *ctx, long crypto_method)
if (ctx && php_stream_context_get_option(ctx, "ssl", "crypto_method", &val) == SUCCESS) {
convert_to_long_ex(val);
crypto_method = (long)Z_LVAL_PP(val);
crypto_method |= STREAM_CRYPTO_IS_CLIENT;
crypto_method |= STREAM_CRYPTO_IS_CLIENT;
}
return crypto_method;
+1
View File
@@ -3,6 +3,7 @@ PDO PgSQL Bug #66584 (Segmentation fault on statement deallocation)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
if (!extension_loaded('json')) die('skip json ext not loaded');
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
+10 -5
View File
@@ -3114,7 +3114,7 @@ PHP_FUNCTION(pg_trace)
php_stream *stream;
id = PGG(default_link);
if (zend_parse_parameters(argc TSRMLS_CC, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
if (zend_parse_parameters(argc TSRMLS_CC, "p|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
return;
}
@@ -5722,9 +5722,6 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
regerr = regexec(&re, str, re.re_nsub+1, subs, 0);
if (regerr == REG_NOMATCH) {
#ifdef PHP_DEBUG
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex);
#endif
ret = FAILURE;
}
else if (regerr) {
@@ -5971,7 +5968,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
else {
/* better regex? */
if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$", 0 TSRMLS_CC) == FAILURE) {
err = 1;
if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^[+-]{0,1}(inf)(inity){0,1}$", 1 TSRMLS_CC) == FAILURE) {
err = 1;
} else {
ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);
php_pgsql_add_quotes(new_val, 1 TSRMLS_CC);
}
}
else {
ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);
@@ -6500,6 +6502,9 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
/* schame.table should be "schame"."table" */
table_copy = estrdup(table);
token = php_strtok_r(table_copy, ".", &tmp);
if (token == NULL) {
token = table;
}
len = strlen(token);
if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) {
smart_str_appendl(querystr, token, len);
+53
View File
@@ -0,0 +1,53 @@
--TEST--
Bug #68638 pg_update() fails to store infinite values
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
include('config.inc');
$conn = pg_connect($conn_str);
$table='test_68638';
pg_query("CREATE TABLE $table (id INT, value FLOAT)");
pg_insert($conn,$table, array('id' => 1, 'value' => 1.2));
pg_insert($conn,$table, array('id' => 2, 'value' => 10));
pg_insert($conn,$table, array('id' => 3, 'value' => 15));
var_dump(pg_update($conn,$table, array('value' => 'inf'), array('id' => 1), PGSQL_DML_STRING));
pg_update($conn,$table, array('value' => 'inf'), array('id' => 1));
pg_update($conn,$table, array('value' => '-inf'), array('id' => 2));
pg_update($conn,$table, array('value' => '+inf'), array('id' => 3));
$rs = pg_query("SELECT * FROM $table");
while ($row = pg_fetch_assoc($rs)) {
var_dump($row);
}
pg_query("DROP TABLE $table");
?>
--EXPECT--
string(52) "UPDATE "test_68638" SET "value"=E'inf' WHERE "id"=1;"
array(2) {
["id"]=>
string(1) "1"
["value"]=>
string(8) "Infinity"
}
array(2) {
["id"]=>
string(1) "2"
["value"]=>
string(9) "-Infinity"
}
array(2) {
["id"]=>
string(1) "3"
["value"]=>
string(8) "Infinity"
}
+38 -41
View File
@@ -598,52 +598,41 @@ int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len
*
* Meta-data is in this format:
* [len32][data...]
*
*
* data is the serialized zval
*/
int phar_parse_metadata(char **buffer, zval **metadata, int zip_metadata_len TSRMLS_DC) /* {{{ */
int phar_parse_metadata(char **buffer, zval **metadata, php_uint32 zip_metadata_len TSRMLS_DC) /* {{{ */
{
const unsigned char *p;
php_uint32 buf_len;
php_unserialize_data_t var_hash;
if (!zip_metadata_len) {
PHAR_GET_32(*buffer, buf_len);
} else {
buf_len = zip_metadata_len;
}
if (buf_len) {
if (zip_metadata_len) {
const unsigned char *p, *p_buff = estrndup(*buffer, zip_metadata_len);
p = p_buff;
ALLOC_ZVAL(*metadata);
INIT_ZVAL(**metadata);
p = (const unsigned char*) *buffer;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
if (!php_var_unserialize(metadata, &p, p + buf_len, &var_hash TSRMLS_CC)) {
if (!php_var_unserialize(metadata, &p, p + zip_metadata_len, &var_hash TSRMLS_CC)) {
efree(p_buff);
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
zval_ptr_dtor(metadata);
*metadata = NULL;
return FAILURE;
}
efree(p_buff);
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
if (PHAR_G(persist)) {
/* lazy init metadata */
zval_ptr_dtor(metadata);
*metadata = (zval *) pemalloc(buf_len, 1);
memcpy(*metadata, *buffer, buf_len);
*buffer += buf_len;
*metadata = (zval *) pemalloc(zip_metadata_len, 1);
memcpy(*metadata, *buffer, zip_metadata_len);
return SUCCESS;
}
} else {
*metadata = NULL;
}
if (!zip_metadata_len) {
*buffer += buf_len;
}
return SUCCESS;
}
/* }}}*/
@@ -653,7 +642,7 @@ int phar_parse_metadata(char **buffer, zval **metadata, int zip_metadata_len TSR
*
* Parse a new one and add it to the cache, returning either SUCCESS or
* FAILURE, and setting pphar to the pointer to the manifest entry
*
*
* This is used by phar_open_from_filename to process the manifest, but can be called
* directly.
*/
@@ -664,6 +653,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
phar_entry_info entry;
php_uint32 manifest_len, manifest_count, manifest_flags, manifest_index, tmp_len, sig_flags;
php_uint16 manifest_ver;
php_uint32 len;
long offset;
int sig_len, register_alias = 0, temp_alias = 0;
char *signature = NULL;
@@ -1029,16 +1019,21 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
mydata->is_persistent = PHAR_G(persist);
/* check whether we have meta data, zero check works regardless of byte order */
PHAR_GET_32(buffer, len);
if (mydata->is_persistent) {
PHAR_GET_32(buffer, mydata->metadata_len);
if (phar_parse_metadata(&buffer, &mydata->metadata, mydata->metadata_len TSRMLS_CC) == FAILURE) {
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
}
} else {
if (phar_parse_metadata(&buffer, &mydata->metadata, 0 TSRMLS_CC) == FAILURE) {
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
mydata->metadata_len = len;
if(!len) {
/* FIXME: not sure why this is needed but removing it breaks tests */
PHAR_GET_32(buffer, len);
}
}
if(len > endbuffer - buffer) {
MAPPHAR_FAIL("internal corruption of phar \"%s\" (trying to read past buffer end)");
}
if (phar_parse_metadata(&buffer, &mydata->metadata, len TSRMLS_CC) == FAILURE) {
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
}
buffer += len;
/* set up our manifest */
zend_hash_init(&mydata->manifest, manifest_count,
@@ -1073,7 +1068,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
entry.manifest_pos = manifest_index;
}
if (buffer + entry.filename_len + 20 > endbuffer) {
if (entry.filename_len + 20 > endbuffer - buffer) {
MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
}
@@ -1109,19 +1104,21 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
entry.flags |= PHAR_ENT_PERM_DEF_DIR;
}
PHAR_GET_32(buffer, len);
if (entry.is_persistent) {
PHAR_GET_32(buffer, entry.metadata_len);
if (!entry.metadata_len) buffer -= 4;
if (phar_parse_metadata(&buffer, &entry.metadata, entry.metadata_len TSRMLS_CC) == FAILURE) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
}
entry.metadata_len = len;
} else {
if (phar_parse_metadata(&buffer, &entry.metadata, 0 TSRMLS_CC) == FAILURE) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
}
entry.metadata_len = 0;
}
if (len > endbuffer - buffer) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
}
if (phar_parse_metadata(&buffer, &entry.metadata, len TSRMLS_CC) == FAILURE) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
}
buffer += len;
entry.offset = entry.offset_abs = offset;
offset += entry.compressed_filesize;
@@ -2217,7 +2214,7 @@ last_time:
/**
* Process a phar stream name, ensuring we can handle any of:
*
*
* - whatever.phar
* - whatever.phar.gz
* - whatever.phar.bz2
+1 -1
View File
@@ -397,7 +397,7 @@ class PharCommand extends CLICommand
*/
static function cli_arg_typ_privkey($arg, $cfg, $key)
{
$arg = self::cli_arg_typ_string($arg, $cfg, $key);
$arg = self::cli_arg_typ_filecont($arg, $cfg, $key);
$hash_avail = Phar::getSupportedSignatures();
if ($arg && !in_array('OpenSSL', $hash_avail))
+9 -4
View File
@@ -124,6 +124,8 @@
#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)
@@ -534,10 +536,13 @@ static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
{
char tmp[MAXPATHLEN];
int tmp_len;
size_t len;
tmp_len = entry->filename_len + entry->phar->fname_len;
memcpy(tmp, entry->phar->fname, entry->phar->fname_len);
memcpy(tmp + entry->phar->fname_len, entry->filename, entry->filename_len);
tmp_len = MIN(MAXPATHLEN, entry->filename_len + entry->phar->fname_len);
len = MIN(entry->phar->fname_len, tmp_len);
memcpy(tmp, entry->phar->fname, len);
len = MIN(tmp_len - len, entry->filename_len);
memcpy(tmp + entry->phar->fname_len, entry->filename, len);
entry->inode = (unsigned short)zend_get_hash_value(tmp, tmp_len);
}
/* }}} */
@@ -570,7 +575,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
char *phar_find_in_include_path(char *file, int file_len, phar_archive_data **pphar TSRMLS_DC);
char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC);
phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
int phar_parse_metadata(char **buffer, zval **metadata, int zip_metadata_len TSRMLS_DC);
int phar_parse_metadata(char **buffer, zval **metadata, php_uint32 zip_metadata_len TSRMLS_DC);
void destroy_phar_manifest_entry(void *pDest);
int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t position, int follow_links TSRMLS_DC);
php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC);
+1 -1
View File
@@ -3624,7 +3624,7 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
phar_entry_data *data;
php_stream *contents_file;
if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1)) {
if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1) && (filename[5] == '/' || filename[5] == '\\' || filename[5] == '\0')) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot create any files in magic \".phar\" directory", (*pphar)->fname);
return;
}
+12 -2
View File
@@ -102,7 +102,7 @@ int phar_is_tar(char *buf, char *fname) /* {{{ */
tar_header *header = (tar_header *) buf;
php_uint32 checksum = phar_tar_number(header->checksum, sizeof(header->checksum));
php_uint32 ret;
char save[sizeof(header->checksum)];
char save[sizeof(header->checksum)], *bname;
/* assume that the first filename in a tar won't begin with <?php */
if (!strncmp(buf, "<?php", sizeof("<?php")-1)) {
@@ -113,7 +113,10 @@ int phar_is_tar(char *buf, char *fname) /* {{{ */
memset(header->checksum, ' ', sizeof(header->checksum));
ret = (checksum == phar_tar_checksum(buf, 512));
memcpy(header->checksum, save, sizeof(header->checksum));
if (!ret && strstr(fname, ".tar")) {
if ((bname = strrchr(fname, PHP_DIR_SEPARATOR))) {
fname = bname;
}
if (!ret && (bname = strstr(fname, ".tar")) && (bname[4] == '\0' || bname[4] == '.')) {
/* probably a corrupted tar - so we will pretend it is one */
return 1;
}
@@ -255,6 +258,12 @@ int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias,
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;
@@ -548,6 +557,7 @@ bail:
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) {
+58
View File
@@ -0,0 +1,58 @@
--TEST--
Bug #64931 (phar_add_file is too restrictive on filename)
--SKIPIF--
<?php extension_loaded("phar") or die("skip need ext/phar support"); ?>
--INI--
phar.readonly=0
--FILE--
<?php
echo "Test\n";
@unlink(__DIR__."/bug64931.phar");
$phar = new Phar(__DIR__."/bug64931.phar");
$phar->addFile(__DIR__."/src/.pharignore", ".pharignore");
try {
$phar->addFile(__DIR__."/src/.pharignore", ".phar/gotcha");
} catch (Exception $e) {
echo "CAUGHT: ". $e->getMessage() ."\n";
}
try {
$phar->addFromString(".phar", "gotcha");
} catch (Exception $e) {
echo "CAUGHT: ". $e->getMessage() ."\n";
}
try {
$phar->addFromString(".phar//", "gotcha");
} catch (Exception $e) {
echo "CAUGHT: ". $e->getMessage() ."\n";
}
try {
$phar->addFromString(".phar\\", "gotcha");
} catch (Exception $e) {
echo "CAUGHT: ". $e->getMessage() ."\n";
}
try {
$phar->addFromString(".phar\0", "gotcha");
} catch (Exception $e) {
echo "CAUGHT: ". $e->getMessage() ."\n";
}
?>
===DONE===
--CLEAN--
<?php
@unlink(__DIR__."/bug64931.phar");
?>
--EXPECT--
Test
CAUGHT: Cannot create any files in magic ".phar" directory
CAUGHT: Cannot create any files in magic ".phar" directory
CAUGHT: Cannot create any files in magic ".phar" directory
CAUGHT: Cannot create any files in magic ".phar" directory
CAUGHT: Cannot create any files in magic ".phar" directory
===DONE===
Loaded 100 of 201 files, more files were not shown because too many files have changed in this diff. Show more