Compare commits

...
698 Commits
Author SHA1 Message Date
Xinchen Hui 9d582eba74 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed arginfo

(cherry picked from commit e4af29b0b7)
2016-07-20 14:17:28 +02:00
Anatol Belski 729121df81 regenerate date parser with re2c 0.13.5
(cherry picked from commit 90c26fb6b1)
2016-07-20 14:10:20 +02:00
Derick Rethans 3b40ee2924 Merge branch 'PHP-5.6' into PHP-7.0
(cherry picked from commit 1dafa806a9)
2016-07-20 14:10:06 +02:00
Derick Rethans 59df5f31d4 Merge branch 'PHP-5.6' into PHP-7.0
(cherry picked from commit 7759d6b0db)
2016-07-20 14:09:52 +02:00
Anatol Belski c9b49bc94b update UPGRADING 2016-07-19 20:33:23 +02:00
Anatol Belski 78cde3d8dc set versions 2016-07-19 18:56:38 +02:00
Anatol Belski 24367afdf3 update NEWS 2016-07-19 18:55:51 +02:00
Pierre Joye bf2633542d #72482, Ilegal write/read access caused by gdImageAALine overflow
(cherry picked from commit b25009fc2c)
2016-07-19 18:38:58 +02:00
Pierre Joye fcb85af809 fix #72494, improve input color check and prevent issues when old gd are used, done before gd call
(cherry picked from commit 1d69028d2f)
2016-07-19 18:38:35 +02:00
Anatol Belski 114d5a3f48 fix test portability and expectation
The test images for #72603 and #72618 are broken, that seems to be
the cause of different test output. Seems also to be platform dependent,
so it's not reliable to depend on the exact error output.

(cherry picked from commit bd1919504b)
2016-07-19 18:07:53 +02:00
Stanislav Malyshev 39aafd71f1 Fix for bug #72513
This is applicable to 7 as well, but was somehow missing from the merge.

(cherry picked from commit 374ae8e9da)
2016-07-19 17:26:14 +02:00
Pierre Joye cc06543112 improve fix #72558, free contribRow as well
(cherry picked from commit 48e76abadd)
2016-07-19 16:46:41 +02:00
Pierre Joye 522253bc9b improve fix #72558, while (u>=0) with unsigned int will always be true
(cherry picked from commit df09515089)
2016-07-19 16:46:25 +02:00
Stanislav Malyshev c3a095af10 Fix memory leak
(cherry picked from commit 47d6ea6332)
2016-07-19 16:46:07 +02:00
Stanislav Malyshev 676f082836 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  5.6.24RC1
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	Zend/zend_virtual_cwd.c
	ext/bz2/bz2.c
	ext/exif/exif.c
	ext/session/session.c
	ext/snmp/snmp.c
	ext/standard/basic_functions.c
	main/SAPI.c
	main/php_variables.c

(cherry picked from commit b00f8f2a5b)
2016-07-19 16:42:37 +02:00
Stanislav Malyshev 1b6e8e5d74 Partial fix for bug #72613 - do not allow reading past error read
(cherry picked from commit 5faa15c4ce)
2016-07-19 15:57:51 +02:00
Pierre Joye 5b48472ec3 fix #72512, invalid read or write for palette image when invalid transparent index is used
(cherry picked from commit 0fbcff1b35)
2016-07-19 15:55:20 +02:00
Stanislav Malyshev 62da85d35d Fix bug #72551 and bug #72552 - check before converting size_t->int
(cherry picked from commit 3810e7b362)
2016-07-19 15:51:34 +02:00
Stanislav Malyshev 159403f795 Fix bug #72541 - size_t overflow lead to heap corruption
(cherry picked from commit 2ca8d85dd4)
2016-07-19 15:51:04 +02:00
Pierre Joye 55f7df2617 fix #72519, possible OOB using imagegif
(cherry picked from commit 2fbce5f51f)
2016-07-19 15:48:57 +02:00
Anatol Belski 9d3b729803 update NEWS 2016-07-14 13:21:38 +02:00
Matteo Beccati 0f182c2495 Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
Special commit for 7.0.9
2016-07-14 12:05:40 +02:00
Anatol Belski 8bd8a64db6 fix possible optimization bug 2016-07-05 15:07:24 +02:00
Anatol Belski a66cae883b set versions 2016-07-05 08:29:51 +02:00
Anatol Belski a4a34c2c0b add missing NEWS entry 2016-07-04 11:05:49 +02:00
Christoph M. Becker 60fc27f912 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-04 03:18:50 +02:00
Christoph M. Becker 717a043a32 Fix typo in comment 2016-07-04 03:17:17 +02:00
Ferenc Kovacs 50433f708e Merge branch 'PHP-5.6' into PHP-7.0 2016-07-03 23:35:00 +02:00
Ferenc Kovacs 9a9ede00bc this was actually fixed in 5.6.23 2016-07-03 23:31:32 +02:00
Xinchen Hui f6aaaf02a9 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  update NEWS
  extend test
  Fixed bug #72534 stream_socket_get_name crashes
2016-07-03 23:57:42 +08:00
Xinchen Hui 612aff3a8a Fixed bug #72538 (readline_redisplay crashes php) 2016-07-03 23:56:27 +08:00
Anatol Belski b90c2fc7b9 update NEWS 2016-07-03 17:15:19 +02:00
Anatol Belski 8b229bfeeb extend test 2016-07-03 17:13:46 +02:00
Anatol Belski ea9da7529c Fixed bug #72534 stream_socket_get_name crashes 2016-07-03 17:09:19 +02:00
Xinchen Hui 6744737577 Fixed bug #72531 (ps_files_cleanup_dir Buffer overflow) 2016-07-03 09:30:33 +08:00
Anatol Belski c9fa39da5e update NEWS 2016-07-01 18:44:20 +02:00
Anatol Belski 3455848dfe Fixed bug #72498 variant_date_from_timestamp null dereference 2016-07-01 18:41:50 +02:00
Nikita Popov 9b8f1d6037 Don't use FUNC_ARG fetches for call_user_func()
This makes no sense -- SEND_USER can't even handle INDIRECTs.
2016-06-28 21:34:20 +02:00
Nikita Popov fafe01b07b Make call_user_func() on reference args consistent
Previously reference arguments were allowed if call_user_func()
was compiled to SEND_USER and not otherwise. Make it consistent
by always forbidding them.
2016-06-28 20:43:38 +02:00
Xinchen Hui 76370f30db Fixed test 2016-06-28 15:39:02 +08:00
Xinchen Hui ce7e180a04 Fixed bug #72508 (strange references after recursive function call and "switch" statement) 2016-06-28 15:36:50 +08:00
Xinchen Hui de7a6b1232 MFH: Fixed fd leak (the origin commit can not be cherry-picked) 2016-06-28 11:36:27 +08:00
Xinchen Hui 86732b4ea0 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fix the fix for #72403 on nl2br
  Update NEWS
  Update NEWS
  Fix #70628: Clearing bindings on an SQLite3 statement doesn't work
  5.5.38 now
2016-06-28 11:11:39 +08:00
Xinchen Hui c73a2f7f45 Fixed bug #72505 (readfile() mangles files larger than 2G) 2016-06-28 11:11:25 +08:00
Stanislav Malyshev ec82c6b4e1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix the fix for #72403 on nl2br
  5.5.38 now

Conflicts:
	ext/standard/string.c
2016-06-27 12:32:58 -07:00
Stanislav Malyshev b8487b6a7d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix the fix for #72403 on nl2br
  5.5.38 now

Conflicts:
	configure.in
	main/php_version.h
2016-06-27 12:32:11 -07:00
Stanislav Malyshev 25bd11cf27 Fix the fix for #72403 on nl2br 2016-06-27 12:30:42 -07:00
Christoph M. Becker b5fc4dbf21 Update NEWS 2016-06-27 17:17:34 +02:00
Christoph M. Becker 0f03224d59 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-27 17:09:55 +02:00
Christoph M. Becker 1314db7109 Update NEWS 2016-06-27 17:07:26 +02:00
Christoph M. Becker 57940605da Fix #70628: Clearing bindings on an SQLite3 statement doesn't work
Obiously, it isn't sufficient to call sqlite3_clear_bindings() alone, but
also the bound_params of the php_sqlite3_stmt have to be cleared.
2016-06-27 17:06:27 +02:00
Lior Kaplan ad32c7b538 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add CVE info for PHP 5.6.22
  Add CVE info for PHP 5.6.23
  Add missing entries for PHP 5.6.23
2016-06-25 21:32:38 +03:00
Lior Kaplan d826bdf1c7 Align NEWS files with 7.0.8 and Changelog 2016-06-25 21:25:57 +03:00
Lior Kaplan b4873e57b4 Add CVE info for PHP 5.6.22 2016-06-25 20:31:26 +03:00
Lior Kaplan 6bd527771c Add CVE info for PHP 5.6.23 2016-06-25 20:28:51 +03:00
Lior Kaplan 02c24be8e4 Add missing entries for PHP 5.6.23 2016-06-25 19:56:00 +03:00
Xinchen Hui 0183a9af5a Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify router.php) 2016-06-24 18:08:16 -07:00
Xinchen Hui 53de1c2830 Fixed format 2016-06-24 21:13:04 +08:00
Anatol Belski 056c2ce349 yet another test rewrite 2016-06-23 09:42:17 +02:00
Xinchen Hui bd74e7d013 Fixed bug #72476 (Memleak in jit_stack) 2016-06-23 14:06:48 +08:00
Anatol Belski f90c832cb2 update NEWS 2016-06-22 20:19:09 +02:00
Anatol Belski 4edbac6ec5 rewrite test 2016-06-22 19:46:02 +02:00
Anatol Belski e453904251 Fixed bug #72463 mail fails with invalid argument 2016-06-22 19:06:33 +02:00
Dmitry Stogov 3c84e5e1ce Allow "proxy" ovjects to substitute their class names through get_class_name() handler (similar to var_dump() and others). 2016-06-22 17:23:04 +03:00
Anatol Belski c196f9cdf7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test cleanup
2016-06-22 12:22:03 +02:00
Anatol Belski 4638ba9c07 fix test cleanup 2016-06-22 12:20:02 +02:00
Anatol Belski 98f6248dcf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix dir separator in test
2016-06-22 11:44:14 +02:00
Anatol Belski de1c407348 fix dir separator in test 2016-06-22 11:41:05 +02:00
Ferenc Kovacs 63d5e21f42 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-22 03:08:10 +02:00
Ferenc Kovacs ba980d0a62 update NEWS 2016-06-22 03:03:01 +02:00
Anatol Belski ed10168b30 fix two remaining tests 2016-06-21 17:24:08 +02:00
Anatol Belski 1d5a4520be Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test
2016-06-21 16:22:51 +02:00
Anatol Belski e3bd360ec9 fix test
There is a difference between TS and NTS warning message, since
virtual_mkdir vs glibc directly is used. This has no effect for
the actual fix functionality.
2016-06-21 16:20:03 +02:00
Anatol Belski 5a9f0c77ad re-fix leak 2016-06-21 15:21:58 +02:00
Anatol Belski 7002c32809 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  re-fix leak
  Revert "fix leak"
2016-06-21 15:21:26 +02:00
Anatol Belski a00350486f re-fix leak 2016-06-21 15:18:10 +02:00
Anatol Belski 9a9249a8d0 Revert "fix leak"
This reverts commit 757105e2a2.
2016-06-21 14:58:15 +02:00
Anatol Belski e6cc30e167 Revert "fix leak"
This reverts commit c5d9c50897.
2016-06-21 14:51:43 +02:00
Anatol Belski e8f2315a00 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak
2016-06-21 13:26:34 +02:00
Anatol Belski 757105e2a2 fix leak 2016-06-21 13:26:12 +02:00
Julien Pauli 155619184f 5.5.38 now 2016-06-21 13:10:37 +02:00
Anatol Belski c5d9c50897 fix leak 2016-06-21 12:29:41 +02:00
Remi Collet 69fd1133d0 bump zip version 2016-06-21 11:16:21 +02:00
Anatol Belski 722ed4c757 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  remove the huge test file, generate it on the fly instead
  remove the huge test file, generate it on the fly instead
2016-06-21 09:54:34 +02:00
Anatol Belski 6d7500c14c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  remove the huge test file, generate it on the fly instead
2016-06-21 09:53:04 +02:00
Anatol Belski 2af71a04b0 remove the huge test file, generate it on the fly instead 2016-06-21 09:48:11 +02:00
Anatol Belski fd93c8601d remove the huge test file, generate it on the fly instead 2016-06-21 09:45:26 +02:00
Anatol Belski 0c7250f260 remove the huge test file, generate it on the fly instead 2016-06-21 09:42:38 +02:00
Stanislav Malyshev 7c389e8429 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Now the right bug #
  Fix NEWS

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:28:17 -07:00
Stanislav Malyshev 5b90a8bd7c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Now the right bug #
  Fix NEWS
2016-06-21 00:27:46 -07:00
Stanislav Malyshev 8705254f2d Merge branch 'PHP-7.0.8' into PHP-7.0
* PHP-7.0.8:
  iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1
  fix NEWS
  set versions

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:25:49 -07:00
Stanislav Malyshev 2a65544f78 Merge branch 'PHP-5.6.23' into PHP-7.0.8
* PHP-5.6.23: (24 commits)
  iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1
  Fix bug #72140 (segfault after calling ERR_free_strings())
  ...

Conflicts:
	configure.in
	ext/mbstring/php_mbregex.c
	ext/mcrypt/mcrypt.c
	ext/spl/spl_array.c
	ext/spl/spl_directory.c
	ext/standard/php_smart_str.h
	ext/standard/string.c
	ext/standard/url.c
	ext/wddx/wddx.c
	ext/zip/php_zip.c
	main/php_version.h
2016-06-21 00:24:32 -07:00
Stanislav Malyshev fc0b0afdc3 Now the right bug # 2016-06-21 00:18:27 -07:00
Stanislav Malyshev 2af6dded37 Fix NEWS 2016-06-21 00:14:56 -07:00
Stanislav Malyshev c9b24ef307 Merge branch 'PHP-5.6.23' into PHP-5.6
* PHP-5.6.23:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:02:37 -07:00
Stanislav Malyshev 7dde353ee7 Merge branch 'PHP-5.5' into PHP-5.6.23
* PHP-5.5:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now

Conflicts:
	configure.in
	ext/mcrypt/mcrypt.c
	ext/spl/spl_directory.c
	main/php_version.h
2016-06-21 00:01:48 -07:00
Stanislav Malyshev c395c6e5d7 iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow 2016-06-20 23:58:26 -07:00
Stanislav Malyshev b028cacf31 update NEWS 2016-06-20 23:45:37 -07:00
Stanislav Malyshev e1d2f86a41 Merge branch 'PHP-5.5.37' into PHP-5.5
* PHP-5.5.37:
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
2016-06-20 23:31:54 -07:00
Stanislav Malyshev 5f107ab8a6 fix tests 2016-06-20 22:54:55 -07:00
Stanislav Malyshev 7f428cae88 fix build 2016-06-20 22:13:31 -07:00
Stanislav Malyshev 6c5211a0ce Fix bug #72455: Heap Overflow due to integer overflows 2016-06-20 21:51:42 -07:00
Stanislav Malyshev f6aef68089 Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize 2016-06-20 21:35:22 -07:00
Stanislav Malyshev 3f627e580a Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize 2016-06-20 21:26:33 -07:00
Remi Collet d002037dc1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #71936 (Segmentation fault destroying HTTP_RAW_POST_DATA)
2016-06-20 18:44:39 +02:00
Remi Collet 1b4570b79f Fix bug #71936 (Segmentation fault destroying HTTP_RAW_POST_DATA) 2016-06-20 18:43:07 +02:00
Christoph M. Becker 4cde87b5b6 Update NEWS 2016-06-20 15:28:41 +02:00
Christoph M. Becker 5cc924e5c2 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-20 15:20:58 +02:00
Christoph M. Becker b3f3cd5903 Update NEWS 2016-06-20 15:18:47 +02:00
Christoph M. Becker 4b4275059f Fix #64641: imagefilledpolygon doesn't draw horizontal line
As has been reported, 1-dimensional horizontal filled polygons are not drawn
at all. That is caused by the scanline algorithm used for drawing filled
polygons which skips the drawing of horizontal edges, because that is
normally not necessary. If, however, the polygon consists of horizontal
edges only, that obviously doesn't work, so we add a special case handling.

That has also been fixed in libgd with
<https://github.com/libgd/libgd/commit/f9f10fa9>.
2016-06-20 15:17:52 +02:00
Stanislav Malyshev 0925e7239d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
2016-06-18 22:13:16 -07:00
Stanislav Malyshev 58797ab895 Update NEWS 2016-06-18 22:13:04 -07:00
Stanislav Malyshev 8c0133f0eb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72447: Type Confusion in php_bz2_filter_create()

Conflicts:
	ext/bz2/bz2_filter.c
2016-06-18 22:11:23 -07:00
Stanislav Malyshev 42b2d7fec5 Fix bug #72447: Type Confusion in php_bz2_filter_create() 2016-06-18 22:10:22 -07:00
Stanislav Malyshev b9ec171e7d Fix bug #72407: NULL Pointer Dereference at _gdScaleVert 2016-06-18 21:57:25 -07:00
Stanislav Malyshev 5b597a2e5b Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free 2016-06-18 21:48:39 -07:00
Xinchen Hui af2c332f41 Update NEWS 2016-06-18 21:34:12 -07:00
Xinchen Hui 6b83832cf4 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	main/streams/xp_socket.c
2016-06-18 21:33:54 -07:00
Xinchen Hui c4c1993af6 Fixed bug #72439 (Stream socket with remote address leads to a segmentation fault) 2016-06-18 21:29:47 -07:00
Stanislav Malyshev e9ac8954be Fix bug #72298 pass2_no_dither out-of-bounds access 2016-06-18 21:06:09 -07:00
Pierre Joye 7722455726 Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow 2016-06-18 20:15:10 +02:00
Christoph M. Becker cc64702796 Update NEWS 2016-06-17 18:00:24 +02:00
Christoph M. Becker eb456d2d27 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-17 17:52:10 +02:00
Christoph M. Becker ed0ec66996 Fix #53640: XBM images require width to be multiple of 8 2016-06-17 17:50:36 +02:00
Xinchen Hui 958f18c1a1 Fixed "implicit declaration of function ‘msgformat_fix_quotes’" 2016-06-17 15:59:41 +08:00
Jakub Zelenka 307e546e1a Merge branch 'PHP-5.6' into PHP-7.0 2016-06-16 20:11:54 +01:00
Jakub Zelenka 0c34f53c93 Fix incorrect error suppressing in openssl_error_string test 2016-06-16 20:11:02 +01:00
Jakub Zelenka 84948e6382 Fix occasionally failing OpenSSL DH bug test
The test was failing when first byte was 0
2016-06-16 20:09:17 +01:00
Christoph M. Becker cc8ffa6911 Update NEWS 2016-06-16 14:33:41 +02:00
Christoph M. Becker 12230c66b1 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-16 14:32:10 +02:00
Christoph M. Becker 5f4113edb3 Update NEWS 2016-06-16 14:26:45 +02:00
Christoph M. Becker 60feda4ea4 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-16 14:06:39 +02:00
Christoph M. Becker 8aa511f1fc Fix #43475: Styled thick horizontal lines are scrambled
Thick lines are drawn by gdImageFilledRectangle(), which iterates over
the x ordinate first (Z order) to apply the style pattern. While this works
fine for vertical and diagonal lines, it obviously fails for horizontal
lines, which have to be iterated over in N order.

To fix this bug, we introduce the helpers  gdImageFilled(H|V)Rectangle(),
which may be reused for other purposes as well.

This is basically the same fix as libgd/libgd/c2b91dbc.
2016-06-16 13:59:00 +02:00
Stanislav Malyshev 7245bff300 Fix bug #72262 - do not overflow int 2016-06-15 21:58:26 -07:00
Stanislav Malyshev 88746d60ab Fix bug #72400 and #72403 - prevent signed int overflows for string lengths 2016-06-15 21:51:28 -07:00
Derick Rethans 8267a5fba7 Fixed expected test outcome due to rule changes 2016-06-15 18:31:41 +01:00
Derick Rethans 76ec139a0a Merge branch 'PHP-5.6' into PHP-7.0 2016-06-15 18:30:03 +01:00
Derick Rethans e0e83c0180 Fixed expected test outcome due to rule changes 2016-06-15 18:29:40 +01:00
Derick Rethans 020541587a Updated to version 2016.5 (2016e) 2016-06-15 11:58:50 +01:00
Derick Rethans a1db72d519 Empty merge 2016-06-15 11:58:49 +01:00
Derick Rethans fffa1aa0f3 Updated to version 2016.5 (2016e) 2016-06-15 11:58:47 +01:00
Xinchen Hui c3fc4194ea Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Maybe fix bug #72011
  Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
  Fix bug #72138 - Integer Overflow in Length of String-typed ZVAL
2016-06-15 14:56:07 +08:00
Xinchen Hui 999a3553d5 Fixed(attempt to) bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) - oob read access)
according to ext/mbstring/oniguruma/enc/utf8.c, max bytes are 6
2016-06-15 14:54:57 +08:00
Nikita Popov 93f7939891 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/date/php_date.c
2016-06-14 22:38:44 +02:00
Nikita Popov 248fdfcf73 Maybe fix bug #72011 2016-06-14 22:37:27 +02:00
Stanislav Malyshev 49b1290617 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
2016-06-14 10:50:45 -07:00
Bartosz Dziewoński 1ab5a1b432 Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
When the location of the data is outside of the range we have
preloaded (for example, if it's before the beginning of the IFD
structure), we have to read it from the stream into a separate buffer.
The offset calculations in this case were incorrect, resulting in
bogus values being read for the affected fields (sometimes parts of
other fields, sometimes binary data).

The included test image, sourced from [1], is in the public domain.

[1] https://commons.wikimedia.org/wiki/File:U.S._Marines_Prepare_to_board_an_MV-22_Osprey_160509-M-AF202-041.jpg
2016-06-14 10:48:08 -07:00
Stanislav Malyshev 79fc877290 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72138 - Integer Overflow in Length of String-typed ZVAL
2016-06-14 01:03:37 -07:00
Stanislav Malyshev 4c968c6ddd Fix bug #72138 - Integer Overflow in Length of String-typed ZVAL 2016-06-14 01:03:03 -07:00
Stanislav Malyshev 489fd56fe3 Fix bug #72275: don't allow smart_str to overflow int 2016-06-14 00:02:17 -07:00
Xinchen Hui 3d56418722 Fixed bug #72399 (Use-After-Free in MBString (search_re)) 2016-06-13 18:20:26 -07:00
Xinchen Hui d1ab974f0b Fixed bug #72306 (Heap overflow through proc_open and $env parameter) 2016-06-13 21:08:04 +08:00
Anatol Belski d3bdbe6395 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now
2016-06-13 08:19:19 +02:00
Stanislav Malyshev a44c89e8af Fix bug #72340: Double Free Courruption in wddx_deserialize 2016-06-12 23:18:23 -07:00
Anatol Belski 93e8f59aab Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now
2016-06-13 08:15:31 +02:00
Anatol Belski 6f73079ce1 update NEWS 2016-06-13 08:12:22 +02:00
Christoph M. Becker f96ebb0986 Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent to clip to zero also.
2016-06-13 08:10:36 +02:00
Stanislav Malyshev d144590d38 Fix bug #72321 - use efree() for emalloc allocation 2016-06-12 21:35:13 -07:00
Jakub Zelenka a2f4c32eb1 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-12 18:39:32 +01:00
Jakub Zelenka 0e2447cd11 Fix bug #71915 (openssl_random_pseudo_bytes is not fork-safe)
Add time to the entropy before using RAND_bytes
2016-06-12 18:14:21 +01:00
Jakub Zelenka 54310d95f9 Fix bug #72336 (openssl_pkey_new does not fail for invalid DSA params) 2016-06-12 18:14:21 +01:00
Jakub Zelenka 4056edd20d Update openssl_error_string to run and be more forgiving 2016-06-12 18:14:21 +01:00
Christoph M. Becker 5d57e25579 Fix #71554: FTP has not built-in support 2016-06-12 13:22:02 +02:00
Christoph M. Becker 07a793810f Merge branch 'PHP-5.6' into PHP-7.0 2016-06-09 15:35:28 +02:00
Christoph M. Becker 1f7cc24df7 Merge branch 'pull-request/1930' into PHP-5.6 2016-06-09 15:28:58 +02:00
Dmitry Stogov bfcf32237e Fixed bug #72369 (array_merge() produces references in PHP7) 2016-06-09 15:07:44 +03:00
Ferenc Kovacs 0307315769 5.6.23RC1 2016-06-09 10:54:35 +02:00
Ferenc Kovacs 65b6950a56 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  5.6.24 will be next
2016-06-09 10:52:26 +02:00
Ferenc Kovacs c26097c2f1 5.6.24 will be next 2016-06-09 10:51:02 +02:00
Jakub Zelenka 84dce33b04 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-08 18:36:36 +01:00
Jakub Zelenka 05033c9ebd Fix bug #72140 (segfault after calling ERR_free_strings()) 2016-06-08 18:21:39 +01:00
Pierre Joye ced675de22 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-06-08 11:08:05 +07:00
Pierre Joye 4d81bf937f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prevent invalid color index (palette only), may lead to crash
  Add CVE to #66387
  add missing NEWS entry
2016-06-08 11:07:32 +07:00
Pierre Joye 6d3fa654b7 prevent invalid color index (palette only), may lead to crash 2016-06-08 11:06:48 +07:00
Lior Kaplan e6211038cb Add CVE to #66387 2016-06-07 21:46:59 +03:00
Lior Kaplan 48d629eb45 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add CVE to #66387
2016-06-07 21:46:25 +03:00
Lior Kaplan 62f9d1e3ae Add CVE to #66387 2016-06-07 21:45:24 +03:00
Anatol Belski 18f30d702c fix NEWS 2016-06-07 18:53:18 +02:00
Anatol Belski 3473406b2a Merge branch 'PHP-7.0' into PHP-7.0.8
* PHP-7.0:
  fix NEWS
  add missing NEWS entry
  update NEWS
  #72337 invalid dimensions can lead to segv
  7.0.9 next

Conflicts:
	configure.in
	main/php_version.h
2016-06-07 18:51:34 +02:00
Anatol Belski 7935a1e2ff fix NEWS 2016-06-07 18:44:40 +02:00
Anatol Belski 74d8429f53 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add missing NEWS entry
2016-06-07 18:42:55 +02:00
Anatol Belski 1d0f128351 add missing NEWS entry 2016-06-07 18:41:17 +02:00
Pierre Joye 99f8a5587b update NEWS 2016-06-07 17:40:55 +07:00
Pierre Joye 3071ba1ff8 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-06-07 17:38:41 +07:00
Pierre Joye 1bbd7fc7eb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  #72337 invalid dimensions can lead to segv
2016-06-07 17:18:14 +07:00
Pierre Joye f80125950c #72337 invalid dimensions can lead to segv 2016-06-07 17:16:40 +07:00
Anatol Belski 407850e8c1 set versions 2016-06-07 10:10:16 +02:00
Anatol Belski 041210f441 7.0.9 next 2016-06-07 10:04:25 +02:00
Anatol Belski edb8c3f6e3 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add test for bug #53735
2016-06-06 21:07:45 +02:00
Anatol Belski 2a0ed8a2eb Add test for bug #53735 2016-06-06 21:06:06 +02:00
Anatol Belski 3e6c02b91a fix ibase handle initialization, mostly compiler warnings 2016-06-06 13:30:17 +02:00
Anatol Belski 174c3371bd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix typo
2016-06-06 08:58:08 +02:00
Anatol Belski eaef8f6db2 fix typo 2016-06-06 08:56:40 +02:00
Anatol Belski 075c75873e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix broken skipif and add xfail for now
2016-06-06 08:21:39 +02:00
Anatol Belski 1b2afd478b fix broken skipif and add xfail for now 2016-06-06 08:20:01 +02:00
Anatol Belski 6ec8b2c57d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  missing return
2016-06-06 07:33:36 +02:00
Anatol Belski c05b417718 missing return 2016-06-06 07:28:12 +02:00
Jakub Zelenka 1f7535234e Merge branch 'PHP-5.6' into PHP-7.0 2016-06-05 17:30:03 +01:00
Jakub Zelenka d4615d1118 Add new test for openssl_pkey_new 2016-06-05 17:27:47 +01:00
Jakub Zelenka 497fe33d6f Add test for openssl_error_string
This test is important for making sure that the error strings
from OpenSSL works as expected and we can safely add a fix
for storing the strings that is prepared.
2016-06-05 17:23:05 +01:00
Jakub Zelenka 5e9f387175 Remove openssl_x509_parse for OpenSSL 0.9.x
The test is unstable and it actually fails with latest 0.9.8
2016-06-05 16:28:50 +01:00
Raphaël Tournoy 1dfdae6de4 fix typo 2016-06-03 17:18:14 +02:00
Anatol Belski f2bc71e43d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fixed bug #70484 selectordinal doesn't work with named parameters
2016-06-02 12:20:46 +02:00
Anatol Belski 2004c25790 update NEWS 2016-06-02 12:18:33 +02:00
Anatol Belski 22336db97f Fixed bug #70484 selectordinal doesn't work with named parameters 2016-06-02 12:17:42 +02:00
Anatol Belski 48ca6dfc70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix ODBC bug for varchars returning with length zero
2016-06-02 12:07:54 +02:00
Elizabeth Marie Smith 72c9324d70 Fix ODBC bug for varchars returning with length zero 2016-06-02 12:04:10 +02:00
Xinchen Hui 31ce3a661a Fixed bug #72308 (fastcgi_finish_request and logging environment variables) 2016-06-02 14:16:32 +08:00
Anatol Belski 51cb58e709 update NEWS 2016-06-01 14:08:32 +02:00
Anatol Belski 79b978db9a Add test for bug #72294 2016-06-01 11:55:35 +02:00
Anatol Belski af8fa8e937 Fixed bug #72294 Segmentation fault/invalid pointer in connection with pgsql_stmt_dtor 2016-06-01 11:55:35 +02:00
Xinchen Hui cf1ad54b64 Also include ini_get 2016-06-01 10:46:04 +08:00
Xinchen Hui f5bc7e881b Forgotten test script for bug #72300 2016-06-01 10:43:53 +08:00
Anatol Belski 1d4d8c7436 fix test portability 2016-05-31 18:42:40 +02:00
Xinchen Hui f2a814df33 Fixed bug #72300 (ignore_user_abort(false) has no effect) 2016-05-31 07:24:02 -07:00
Xinchen Hui 953ee61a49 No sure why this is failed in travis 2016-05-31 17:22:47 +08:00
Xinchen Hui 47fa763fae Fixed test (keyword is local related) 2016-05-31 16:55:58 +08:00
Xinchen Hui 072bc589fc Attempt to fix tests fails 2016-05-31 16:48:19 +08:00
Xinchen Hui d1dd9b4558 Re-Fixed bug #72155 (use-after-free caused by get_zval_xmlrpc_type) 2016-05-31 11:44:20 +08:00
Xinchen Hui a811b5e38d Revert "fix #72155 (use-after-free caused by get_zval_xmlrpc_type)"
This reverts commit 1690dcb827.
2016-05-31 11:32:09 +08:00
Anatol Belski 2524ab9e67 fix condition 2016-05-30 18:35:14 +02:00
Anatol Belski c101690972 update NEWS 2016-05-30 14:10:27 +02:00
Bob Weinand 67468fb417 Fixed bug #72284 (phpdbg fatal errors with coverage)
Cherry-pick of original commits d3371b and 0f20e11 only present in master
2016-05-30 13:31:17 +02:00
Anatol Belski 933d6b188c fix test title 2016-05-30 12:48:00 +02:00
Anatol Belski 97c530fece Add test for bug #72258 2016-05-30 12:47:04 +02:00
Anatol Belski f6e79af3ef update UPGRADING 2016-05-30 10:32:43 +02:00
Anatol Belski 2c80459c24 Expose missing flags from libzip at least >= 0.11.x
These are helpful with reading/writing zips containing non UTF-8
filenames to mitigate possibly changed libzip behaviors.

Partial cherry-pick of 893c2405ff
2016-05-30 10:32:43 +02:00
Joe Watkins 1690dcb827 fix #72155 (use-after-free caused by get_zval_xmlrpc_type) 2016-05-30 08:56:50 +01:00
Joe Watkins 0c5bd4d445 This is exported at implementation site, but no forward declaration can cause compile warnings 2016-05-29 06:02:38 +01:00
Nikita Popov 4746e5efcb Forbid "yield from" in force closed generators
Same check we do for "yield", was missed when "yield from" was
added. We could make this more granular by only forbidding to
actually yield values and still allow something like "yield from []",
but this does not seem worthwhile.
2016-05-28 13:21:05 +02:00
Xinchen Hui d29bd582a8 Added NEWS Entry 2016-05-28 16:12:10 +08:00
Lauri Kenttä 58302192b7 Test for bug #72221, segfault in zend_memnstr_ex 2016-05-28 16:10:29 +08:00
Lauri Kenttä 287f9489d8 Fix bug #72221 (segfault, past-the-end access) 2016-05-28 16:10:16 +08:00
Ferenc Kovacs cc0d237664 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-05-26 03:05:52 +02:00
Ferenc Kovacs 6e5958e37d update NEWS 2016-05-26 03:05:06 +02:00
Adam Harvey c523dfdb49 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix typo in phpdbg help.
2016-05-25 12:47:49 -05:00
Adam Harvey 54eb659032 Fix typo in phpdbg help.
Sorry, I would have included this in the last push had I spotted it a
minute earlier.
2016-05-25 12:47:35 -05:00
Adam Harvey ac29f9de86 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add missing newlines to phpdbg's help for the run command.
2016-05-25 12:40:23 -05:00
Adam Harvey e623e91e27 Add missing newlines to phpdbg's help for the run command.
This is not at all related to needing screenshots for a talk I'm giving
in two days. No sir. Not at all.
2016-05-25 12:38:41 -05:00
Remi Collet 4dd03651f3 Skip test which is 64bits only
Diff from test output
001+ Warning: fread(): Length parameter must be greater than 0 in ...
001- Warning: fread(): Length parameter must be no more than 2147483647 in ...
2016-05-25 16:40:52 +02:00
Remi Collet 815b5fe7ae Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Skip test which is 64bits only
2016-05-25 16:19:52 +02:00
Remi Collet ce932f6479 Skip test which is 64bits only
Diff from test output
001+ Warning: fread(): Length parameter must be greater than 0 in ...
001- Warning: fread(): Length parameter must be no more than 2147483647 in ...
2016-05-25 16:17:12 +02:00
Julien Pauli 0c84740450 5.5.37 now 2016-05-25 11:37:58 +02:00
Anatol Belski 1f3f46cc60 update NEWS 2016-05-25 11:30:00 +02:00
Anatol Belski 02a3a93f9b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test portability
2016-05-25 11:21:16 +02:00
Anatol Belski 65a2c451bb fix test portability 2016-05-25 11:19:19 +02:00
Anatol Belski 8dab872a43 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.22RC1
2016-05-25 11:15:39 +02:00
Stanislav Malyshev 2fe563e8d8 Merge branch 'PHP-7.0.7' into PHP-7.0
* PHP-7.0.7:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  set versions
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	configure.in
	main/php_version.h
2016-05-24 20:51:52 -07:00
Stanislav Malyshev 3ed0114e7f Merge branch 'PHP-5.5' into PHP-7.0.7
* PHP-5.5:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	Zend/zend_operators.c
	ext/intl/locale/locale_methods.c
	ext/phar/dirstream.c
	ext/phar/tests/bug71331.phpt
	ext/standard/file.c
	ext/standard/html.c
2016-05-24 18:05:06 -07:00
Stanislav Malyshev 2464b092eb Merge branch 'PHP-5.6.22' into PHP-5.6
* PHP-5.6.22:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  prepare for 5.6.22RC1
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	configure.in
	main/php_version.h
2016-05-24 17:21:22 -07:00
Stanislav Malyshev 544940c48a Merge branch 'PHP-5.5' into PHP-5.6.22
* PHP-5.5:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	Zend/zend_operators.c
	ext/phar/dirstream.c
	ext/phar/tests/bug71331.phpt
2016-05-24 16:56:36 -07:00
Stanislav Malyshev 9a826a3bd9 Fix memory leak in imagescale() 2016-05-24 16:12:01 -07:00
Stanislav Malyshev f423e1bb89 Update NEWS 2016-05-24 15:56:02 -07:00
Stanislav Malyshev e955913115 Better fix for bug #72135 2016-05-24 15:52:15 -07:00
Stanislav Malyshev 7a1aac3343 Fixed bug #72227: imagescale out-of-bounds read
Ported from https://github.com/libgd/libgd/commit/4f65a3e4eedaffa1efcf9ee1eb08f0b504fbc31a
2016-05-23 00:34:35 -07:00
Stanislav Malyshev 97eff7eb57 Fix bug #72241: get_icu_value_internal out-of-bounds read 2016-05-22 17:49:02 -07:00
Derick Rethans c572968900 Merge branch 'PHP-5.6' into PHP-7.0 2016-05-18 12:19:49 +01:00
Derick Rethans f43f6fc39b Fixed bug #63740 (strtotime seems to use both sunday and monday as start of week) 2016-05-18 12:19:11 +01:00
Dmitry Stogov d41920c57d Use PHP_VERSION as OPcahce version 2016-05-17 17:16:10 +03:00
Xinchen Hui 2eb7e75c25 Let's only read-only here 2016-05-17 18:07:20 +08:00
Xinchen Hui 7989db975f Fixed bug #72229 (Wrong reference when serialize/unserialize an object) 2016-05-17 17:40:26 +08:00
Anatol Belski 7e5ea3c305 update NEWS 2016-05-16 19:30:38 +02:00
Thomas Punt 0e21742bf8 Tidy up 2016-05-16 19:15:40 +02:00
Thomas Punt 367fde9947 Remove unnecessary boundary checks 2016-05-16 19:15:40 +02:00
Thomas Punt 39052d4d75 Resolve bug #72017 2016-05-16 19:15:40 +02:00
Xinchen Hui 6f4860545b Revert "Revert the ABI break commit"
This reverts commit 07220f615b.
2016-05-16 06:23:55 -07:00
Xinchen Hui 0b3a4c6101 Revert "Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)""
obviously I read the change is in argument lists by mistake :<

This reverts commit 9e7afa7514.
2016-05-16 06:22:13 -07:00
Xinchen Hui 8578fb994b Correct name, it was typed in habitually 2016-05-16 14:48:13 +08:00
Stanislav Malyshev 0da8b8b801 Fix bug #72135 - don't create strings with lengths outside int range 2016-05-15 23:26:51 -07:00
Xinchen Hui 07220f615b Revert the ABI break commit 2016-05-16 11:24:39 +08:00
Xinchen Hui 9e7afa7514 Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)"
ABI break

This reverts commit fb951553be.
2016-05-16 11:24:16 +08:00
Xinchen Hui 1559fd7e48 Fixed bug #72218 (If host name cannot be resolved then PHP 7 crashes) 2016-05-16 11:19:45 +08:00
Joe Watkins fb951553be fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs) 2016-05-14 08:20:41 +01:00
Joe Watkins b165114013 fix #72206 (xml_parser_create/xml_parser_free leaks mem) 2016-05-14 08:10:16 +01:00
Joe Watkins 1524e00ccc improve 7132fe19c2 2016-05-13 12:47:36 +01:00
Joe Watkins 7132fe19c2 fix 1bb8a7b0b8 2016-05-13 09:25:15 +01:00
Joe Watkins 1bb8a7b0b8 fix #72180 (Env variables incorrectly pretty printed in config.nice, phpinfo) 2016-05-13 07:41:11 +01:00
Anatol Belski f751b1ceaf fix dir separator in test 2016-05-12 20:37:04 +02:00
Anatol Belski d33f258495 update NEWS 2016-05-12 13:39:15 +02:00
Anatol Belski 9f50bb5bfa workaround the extra new line in the test out on another env 2016-05-12 12:45:04 +02:00
Anatol Belski 7f6e285430 Fixed bug #72197 pg_lo_create arbitrary read 2016-05-12 11:40:28 +02:00
Xinchen Hui 3797e570b2 Added NEWS entry missed while doing merge 2016-05-12 13:48:24 +08:00
Xinchen Hui 92828ae204 Committed by accident 2016-05-12 13:40:22 +08:00
Xinchen Hui d1926742aa Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fix serializing ZEND_AST_SHELL_EXEC
  add missing NEWS entry
  prepare for 5.6.22RC1
  add missing NEWS entry
2016-05-12 13:16:07 +08:00
Xinchen Hui 3c0341e6f9 Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free) 2016-05-12 13:15:33 +08:00
Sara Golemon a73b03edea Fix serializing ZEND_AST_SHELL_EXEC
Currently, `foo` is reserialized as `'foo'` due to misuse of zend_ast_export().
ZEND_AST_SHELL_EXEC can only contain ZEND_AST_ZVAL(string) or ZEND_AST_ENCAPS_LIST,
so just handle the ZEND_AST_ZVAL(string) case directly.
2016-05-12 02:47:56 +00:00
Ferenc Kovacs fe6af26e2d prepare for 5.6.22RC1 2016-05-11 23:34:15 +02:00
Ferenc Kovacs 414eb83460 add missing NEWS entry 2016-05-11 23:31:52 +02:00
Ferenc Kovacs edcc97df39 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.22RC1
  add missing NEWS entry
2016-05-11 23:31:09 +02:00
Ferenc Kovacs 0815f7f755 prepare for 5.6.22RC1 2016-05-11 23:30:04 +02:00
Ferenc Kovacs 89e4862e5f add missing NEWS entry 2016-05-11 23:29:23 +02:00
Xinchen Hui df404e2e0e Fixed Bug #72193 (dns_get_record returns array containing elements of type 'unknown') 2016-05-11 17:31:46 +08:00
Xinchen Hui 66ad4fc393 Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound) 2016-05-11 11:12:27 +08:00
Derick Rethans c35bd4861d Allow for special case for the opcache zend extension 2016-05-10 15:40:03 -04:00
Anatol Belski 0718aa5833 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix handle leak
2016-05-10 20:02:17 +02:00
Anatol Belski 6b63d80a7a fix handle leak 2016-05-10 19:59:48 +02:00
Dmitry Stogov f7372f648f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  The "flock" structure has to be writable on AIX.
2016-05-10 17:53:33 +03:00
Dmitry Stogov 90f43caf5b The "flock" structure has to be writable on AIX. 2016-05-10 17:50:14 +03:00
Anatol Belski 2beacaad49 set versions 2016-05-10 13:16:44 +02:00
Anatol Belski 09dae4dc85 prepare next 7.0.8 2016-05-10 13:06:55 +02:00
Nikita Popov a1ed4ab3ca Fixed bug #72174
Also fixes a memory leak if ::getValue() is used with __get().
2016-05-10 12:13:10 +02:00
Stanislav Malyshev 41fc3c76e9 Add check for string overflow to all string add operations 2016-05-09 22:17:20 -07:00
Stanislav Malyshev abd159cce4 Fix bug #72114 - int/size_t confusion in fread 2016-05-09 21:55:29 -07:00
Anatol Belski 3407931108 update NEWS 2016-05-09 18:51:54 +02:00
Anatol Belski a430f8a562 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-05-09 18:51:25 +02:00
Anatol Belski 0ea2bfb30e update NEWS 2016-05-09 18:50:40 +02:00
Anatol Belski fc2a45b70a Revert "Fixed bug #71820 pg_fetch_object bind parameters before call constructor"
This reverts commit b4eedd128b.

This fixed bug #72151, and reverts the fix for bug #71820.
See also bug #50636 and #49521 for the history.
2016-05-09 17:25:53 +02:00
Anatol Belski 692c262526 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Revert "Backport patch for bug #71820"
2016-05-09 17:23:40 +02:00
Anatol Belski 1cc536af5a Revert "Backport patch for bug #71820"
This reverts commit 1b632cfe83.

This fixed bug #72151, and reverts the fix for bug #71820.
See also bug #50636 and #49521 for the history.
2016-05-09 17:15:40 +02:00
Anatol Belski f152c3fa57 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #64524 Add intl.use_exceptions to php.ini-*
2016-05-08 15:12:20 +02:00
Anatol Belski 41b159fd11 Fixed bug #64524 Add intl.use_exceptions to php.ini-* 2016-05-08 15:09:50 +02:00
Xinchen Hui 69adf2370e Fixed test 2016-05-07 22:04:20 -07:00
Xinchen Hui 29079f263e Strlen cleanup (additions for previous one fix)
Probably compilers will do similar optimization
2016-05-07 00:08:15 -07:00
Xinchen Hui f7439afeda Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_strtod.c
2016-05-06 23:52:48 -07:00
Xinchen Hui 1c7f608071 Fixed bug #72172 (zend_hex_strtod should not use strlen) 2016-05-06 23:52:06 -07:00
Xinchen Hui 197470b62f Revert "Fixed bug #72170 (JsonSerializable may inc apply count without dec it)"
This reverts commit 459a7cc209.
2016-05-06 20:25:24 +08:00
Xinchen Hui 459a7cc209 Fixed bug #72170 (JsonSerializable may inc apply count without dec it)
I don't want use zend_try here, but seems I have no choice :<
2016-05-06 18:38:26 +08:00
Anatol Belski 627b5aae3f update NEWS 2016-05-06 09:41:21 +02:00
Anatol Belski d76638b491 reorder entry alphabetically 2016-05-06 09:39:02 +02:00
Anatol Belski 5afba67bfe Re-fix #72165
Reverted previous wrong patch, throw warning for numeric keys.
Numeric field names are not supported, see "distinguished name"
section here https://www.openssl.org/docs/manmaster/apps/req.html
2016-05-06 09:30:41 +02:00
Anatol Belski dd5479ea4c Revert "Fixed bug #72165 Null pointer dereference - openssl_csr_new"
This reverts commit 7277c85765.
2016-05-06 09:19:04 +02:00
Anatol Belski 7277c85765 Fixed bug #72165 Null pointer dereference - openssl_csr_new 2016-05-06 09:01:27 +02:00
Xinchen Hui 080f6b10ec Fixed test 2016-05-06 10:51:38 +08:00
Xinchen Hui 441d1b8ef0 Revert "Fix bug #72162 (again)"
The problem is because we release p->value too early

and later you try to convert an object to string, which is a fatal error

then leave p->value double free, change to expect long is a BC break

This reverts commit 8e5b381004.
2016-05-06 10:45:44 +08:00
Nikita Popov 8e5b381004 Fix bug #72162 (again)
Not sure what the previous fix was supposed to do. The issue was
that error_reporting() simply assumes that the value must either
be an integer or a string.

Fixed by using zpp properly.
2016-05-05 17:28:52 +02:00
Xinchen Hui 395863b1d1 Fixed bug #72164 (Null Pointer Dereference - mb_ereg_replace) 2016-05-05 17:27:34 +08:00
Xinchen Hui c15b6134f6 Fixed bug #72154 (pcntl_wait/pcntl_waitpid array internal structure overwrite) 2016-05-05 15:18:17 +08:00
Xinchen Hui 1a5d58b28f Fixed bug #72157 (use-after-free caused by dba_open) 2016-05-05 11:12:17 +08:00
Xinchen Hui 9191862121 Fixed bug #72162 (use-after-free - error_reporting) 2016-05-05 11:02:21 +08:00
Nikita Popov 0691e7a8e1 Fix JMPZ, JMPZNZ_EX chain optimization
The result_type was not copied, resulting in a corrupted JMPZ_EX.
Fix can be verified by inspecting the opcodes of the following
function (it should not contain any _EX opcodes):

function test() {
    if ($a && $b) {
        echo "a";
    }

    if ($b || $c || $d) {
        echo "b";
    }
}

Conflicts:
	ext/opcache/Optimizer/block_pass.c
2016-05-05 00:00:56 +02:00
Nikita Popov 9af0c96af4 Fix bug #72159 2016-05-04 18:43:11 +02:00
Anatol Belski 44372d6953 fix NEWS, patch for #71428 was reverted 2016-05-04 18:14:11 +02:00
Joe Watkins a17e4187e7 correct wording 2016-05-04 17:04:38 +01:00
Joe Watkins 9bbee305e3 add compiler option to disable builtins (special case function calls) 2016-05-04 10:53:59 +01:00
Anatol Belski 2d0081cebd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add test fo rbug 71805
2016-05-03 19:10:40 +02:00
Anatol Belski 5351151352 add test fo rbug 71805 2016-05-03 19:09:11 +02:00
Anatol Belski 578ba03339 update libs versions 2016-05-03 18:27:21 +02:00
Anatol Belski 07519d4c4b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  upate libs versions
2016-05-03 18:27:03 +02:00
Anatol Belski a387075954 upate libs versions 2016-05-03 18:24:35 +02:00
Nikita Popov fbae590bf0 Fix leaks in QM_ASSIGN, JMP_SET and COALESCE
The QM_ASSIGN code was rewritten to use the standard pattern for
handling CVs and VARs.
2016-05-03 18:12:56 +02:00
Bob Weinand b4c5009220 Mark fcc as initialized for object calls
This results in 1% speedup (cycle count) on some real world applications
2016-05-03 02:07:06 +02:00
Nikita Popov ec7c3c22b6 Fix leak in zend_get_constant_ex 2016-05-02 19:59:43 +02:00
Bob Weinand 45c0301b69 Added NEWS entry for socket_export_stream()
Closes pull request https://github.com/php/php-src/pull/762
2016-05-02 17:11:26 +02:00
Chris Wright e8abb70fc9 Implement socket_export_stream() 2016-05-02 17:08:15 +02:00
Julien Pauli 95ed19ae28 Updated NEWS 2016-05-02 16:52:58 +02:00
Julien Pauli a4abd2bed9 Backport of fixed for bug #71331 - Uninitialized pointer in phar_make_dirstream() 2016-05-02 16:49:47 +02:00
Nikita Popov d5a38280be Drop dup declare with inconsistent linkage
This is already declared in zend_stream.h as ZEND_API.
2016-05-02 11:56:28 +02:00
Anatol Belski 5360b3de33 fix test if unlink fails occasionally 2016-05-01 19:25:39 +02:00
Anatol Belski 81e62e66d6 fix dir separator in test 2016-05-01 19:05:02 +02:00
Anatol Belski 2acdf68b5a Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-05-01 13:23:35 +02:00
Anatol Belski bb7cae788e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update PHP 5.5 NEWS entries with CVE info
  Added CVE
  Updated NEWS
2016-05-01 13:19:48 +02:00
Anatol Belski 20359deae6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update PHP 5.5 NEWS entries with CVE info
  Added CVE
  Updated NEWS
2016-05-01 13:18:24 +02:00
Lior Kaplan 5c571626e3 Update PHP 5.5 NEWS entries with CVE info 2016-05-01 13:14:57 +02:00
Nikita Popov 8e855534b7 Fix posix build 2016-05-01 13:07:01 +02:00
Nikita Popov d0069ca6c1 Fix ('\bar')() in namespace 2016-05-01 13:05:14 +02:00
Xinchen Hui 895337ddbd Fixed bug #72133 (php_posix_group_to_array crashes if gr_passwd is NULL) 2016-05-01 11:00:41 +08:00
Sara Golemon d0b952260e Create temporary sqlite db in test dir rather than cwd (and clean it up)
Well behaved tests do not leave their droppings all over the filesystem.
2016-04-30 06:02:01 +00:00
Anatol Belski 8c74f03c10 fix test 2016-04-29 14:30:19 +02:00
Pierrick Charron 3c92f113e4 Expose some of the new curl constants to PHP userspace 2016-04-29 14:19:55 +02:00
Lior Kaplan 9943c32242 Add CVE IDs PHP 7.0.0 2016-04-29 13:41:29 +03:00
Lior Kaplan 5a578eb8f0 Add CVE IDs PHP 7.0.2 2016-04-29 13:40:44 +03:00
Lior Kaplan 8c215baae7 Add CVE IDs PHP 7.0.3 2016-04-29 13:40:07 +03:00
Lior Kaplan 8491a4e438 Add CVE IDs PHP 7.0.4 2016-04-29 13:39:03 +03:00
Lior Kaplan 19b5e950e7 Add CVE IDs PHP 7.0.5 2016-04-29 13:38:25 +03:00
Lior Kaplan 34dec87343 Add CVE to bug #71912 (PHP 7.0.6) 2016-04-29 13:36:24 +03:00
Lior Kaplan 6e68b44843 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add CVE to bug #69719 (PHP 5.6.10)
  Add CVE IDs PHP 5.6.12
  Add CVE IDs PHP 5.6.13
  Add CVE IDs PHP 5.6.14
  Add CVE to bug #70976 (PHP 5.6.17)
  Add CVE IDs PHP 5.6.18
  Add CVE IDs PHP 5.6.20
  Add CVE to bug #71912 (PHP 5.6.21)
2016-04-29 13:26:46 +03:00
Lior Kaplan 76a5117da7 Add CVE to bug #69719 (PHP 5.6.10) 2016-04-29 13:23:41 +03:00
Lior Kaplan eeea33db68 Add CVE IDs PHP 5.6.12 2016-04-29 13:21:35 +03:00
Lior Kaplan 26f8ee48d6 Add CVE IDs PHP 5.6.13 2016-04-29 13:19:46 +03:00
Lior Kaplan 91fd5406bc Add CVE IDs PHP 5.6.14 2016-04-29 13:17:34 +03:00
Lior Kaplan 34fc0ec377 Add CVE to bug #70976 (PHP 5.6.17) 2016-04-29 13:16:27 +03:00
Lior Kaplan a23ae0f436 Add CVE IDs PHP 5.6.18 2016-04-29 13:15:30 +03:00
Lior Kaplan b8b2dd1a43 Add CVE IDs PHP 5.6.20 2016-04-29 13:11:54 +03:00
Lior Kaplan a91c3f1dd0 Add CVE to bug #71912 (PHP 5.6.21) 2016-04-29 13:10:13 +03:00
Joe Watkins dbae1653da fix size_t signed comparison 2016-04-29 10:19:55 +01:00
Julien Pauli 6058b78878 Added CVE 2016-04-29 09:12:27 +02:00
Xinchen Hui a5718539b1 Fixed build 2016-04-29 11:13:15 +08:00
Lior Kaplan 9e57360c83 Add NEWS entry for bug #71331 (fixed in 7.0.3) 2016-04-28 21:12:27 +03:00
Lior Kaplan b18da2a322 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add NEWS entry for bug #71331 (fixed in PHP 5.6.18)
2016-04-28 21:12:00 +03:00
Stanislav Malyshev 9649ca1630 Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream() 2016-04-28 20:57:44 +03:00
Lior Kaplan e70fe1c42e Add NEWS entry for bug #71331 (fixed in PHP 5.6.18) 2016-04-28 20:46:29 +03:00
Anatol Belski 67b5d647dd update NEWS 2016-04-28 19:46:15 +02:00
Dmitry Stogov d851e8389c Added test 2016-04-28 20:12:42 +03:00
Dmitry Stogov 9e45ac53ce Fixed BC break described by bug #72119.
It was introduced after 7.0.5 release by attempt to fix bug #71428.
2016-04-28 19:56:10 +03:00
Joe Watkins 2787a24f86 simplify expression 2016-04-28 15:52:30 +01:00
Joe Watkins f580540c8d simplify expression 2016-04-28 15:50:27 +01:00
Joe Watkins 64721f143a Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-04-28 15:41:23 +01:00
Joe Watkins e27a43b7be variable used out of scope 2016-04-28 15:40:28 +01:00
Bob Weinand 74ef863f5d Fixed bug #72116 (7.0.6 array_fill optimization breaks implementation) 2016-04-28 11:02:47 +02:00
Ferenc Kovacs 595d19bcfa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  small whitespace fix
2016-04-28 02:37:01 +02:00
Ferenc Kovacs 227e5d1153 small whitespace fix 2016-04-28 02:32:45 +02:00
Anatol Belski a877c7ae29 update NEWS 2016-04-27 18:58:28 +02:00
Anatol Belski 759271ff34 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-04-27 14:56:35 +02:00
Anatol Belski 05df0951b2 update NEWS 2016-04-27 14:56:08 +02:00
Anatol Belski 0c529b3899 update NEWS 2016-04-27 14:50:46 +02:00
Xinchen Hui a05320c419 Use zend_string_safe_alloc 2016-04-27 20:29:11 +08:00
Anatol Belski 25ef19f927 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix/improve tests
2016-04-27 13:19:29 +02:00
Anatol Belski a21a997478 fix/improve tests 2016-04-27 13:16:57 +02:00
Anatol Belski 4bc97db0b8 fix merge 2016-04-27 12:24:28 +02:00
Julien Pauli 008f983ba6 Updated NEWS 2016-04-27 11:55:05 +02:00
Anatol Belski 33d41da347 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix memory leak
  Fix bug #72099: xml_parse_into_struct segmentation fault
  5.5.36 now
  Fix bug #72094 - Out of bounds heap read access in exif header processing
  Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
  Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset
  Fix for bug #71912 (libgd: signedness vulnerability)
  Typo in NEWS
2016-04-27 11:45:29 +02:00
Stanislav Malyshev e315a162da Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix memory leak
  Fix bug #72099: xml_parse_into_struct segmentation fault
  5.5.36 now
  Fix bug #72094 - Out of bounds heap read access in exif header processing
  Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
  Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset
  Fix for bug #71912 (libgd: signedness vulnerability)
  Typo in NEWS

Conflicts:
	configure.in
	main/php_version.h
2016-04-26 23:48:41 -07:00
Stanislav Malyshev a32e143d4e fix build 2016-04-26 23:04:29 -07:00
Stanislav Malyshev ccc12efa32 Fix bug #71923 - integer overflow in ZipArchive::getFrom* 2016-04-26 22:59:09 -07:00
Stanislav Malyshev 61c7a06e7c Fix memory leak 2016-04-26 22:54:58 -07:00
Stanislav Malyshev dccda88f27 Fix bug #72099: xml_parse_into_struct segmentation fault 2016-04-26 22:46:28 -07:00
Xinchen Hui c89b7a4860 Use zend_string_safe_alloc 2016-04-27 12:45:02 +08:00
Julien Pauli f856734c67 5.5.36 now 2016-04-26 22:34:00 +02:00
Dmitry Stogov 4ce8a15eae Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test on 32-bit platforms (split into 32-bit and 64-bit versions)
2016-04-26 13:44:52 +03:00
Dmitry Stogov 9f389cccfd Fixed test on 32-bit platforms (split into 32-bit and 64-bit versions) 2016-04-26 13:43:18 +03:00
Dmitry Stogov 8f0ceb97cf Fixed bug #72100 (implode() inserts garbage into resulting string when joins very big integer). (Mikhail Galanin) 2016-04-26 13:04:06 +03:00
Dmitry Stogov 92233dd736 Fixed bug #72101 (crash on complex code) 2016-04-25 14:11:46 +03:00
Stanislav Malyshev 082aecfc3a Fix bug #72094 - Out of bounds heap read access in exif header processing 2016-04-24 19:33:52 -07:00
Stanislav Malyshev d650063a04 Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
We can not modify result since it can be copy of _zero_ or _one_, etc. and
"copy" in bcmath is just bumping the refcount.
2016-04-24 18:33:32 -07:00
Stanislav Malyshev fd9689745c Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset 2016-04-24 13:15:17 -07:00
Pierrick Charron a2d78d1a5f Fixed bug #68658 (Define CURLE_SSL_CACERT_BADFILE) 2016-04-23 22:55:00 -04:00
Pierrick Charron 043ce195c6 Fix cURL test to use local server instead of google 2016-04-23 18:37:55 -04:00
Anatol Belski e0edb25cf2 Fixed bug #72035 php-cgi.exe fails to run scripts relative to drive root 2016-04-23 18:55:52 +02:00
Xinchen Hui 589d0e0f18 Fixed bug #72069 (Behavior \JsonSerializable different from json_encode) 2016-04-22 21:41:44 -07:00
Xinchen Hui 9eb7c8cd3b Fixed bug #72075 (Referencing socket resources breaks stream_select) 2016-04-22 21:21:49 -07:00
Nikita Popov 988bdd0908 Fix escape sequences in pgsql.c 2016-04-21 23:41:59 +02:00
Bob Weinand 69efeb1223 Fix constant expr coaleasce with protected mode opcache 2016-04-21 21:51:00 +02:00
Bob Weinand 5053fc078d Fixed bug #72059 - Reference the bug id directly in NEWS 2016-04-21 02:48:52 +02:00
Bob Weinand a287c3f776 Fix magic constants (__LINE__) with ?? for constant scalar exprs
Also fix general memory leak when root ast gets replaced in compile time evaluation
2016-04-21 02:45:09 +02:00
Bob Weinand 672a99597c Add NEWS entry for ?? in constant scalar expressions 2016-04-21 01:24:56 +02:00
Márcio Almada 9f3eab44df allow null coalescing (??) on constant expressions 2016-04-21 01:22:28 +02:00
Nikita Popov 85867268fd Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_compile.c
2016-04-20 19:00:02 +02:00
Adam Harvey c4f69b6dfd Fix ZTS builds by adding a missing TSRMLS_FETCH(). 2016-04-20 18:58:29 +02:00
Nikita Popov 77bb96d7c9 Fix bug #71737
Also improve the error message for $this used in parameters.
2016-04-20 18:38:40 +02:00
Xinchen Hui ede06b7e20 Update NEWS 2016-04-20 08:42:06 -07:00
Nikita Nefedov 19759a5602 Fix RECV opcode to handle all kinds of exceptions
fix RECV opcode to handle exceptions thrown from user-defined error handler
as a result Notice error from failed type coercion
2016-04-20 08:40:44 -07:00
Stanislav Malyshev 7d93363bd9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Better fix for #71952

Conflicts:
	ext/gd/gd.c
2016-04-19 23:45:21 -07:00
Stanislav Malyshev c02301b666 Better fix for #71952 2016-04-19 23:44:00 -07:00
Stanislav Malyshev 086729bb6c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #71952: Corruption inside imageaffinematrixget

Conflicts:
	ext/gd/gd.c
2016-04-18 23:34:26 -07:00
Stanislav Malyshev f061867fd3 Fix bug #71952: Corruption inside imageaffinematrixget 2016-04-18 23:33:21 -07:00
Stanislav Malyshev b15f0ecc0f Fix for bug #71912 (libgd: signedness vulnerability) 2016-04-18 22:24:16 -07:00
Xinchen Hui 5ea2b3625d Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Prevent usage in GC after free.
  Fix SEND_USER as well
  Fix SEND_ARRAY+PREFER_REF SHM corruption
2016-04-19 10:59:35 +08:00
Xinchen Hui 7648f20de3 Fixed bug #72051 (The reference in CallbackFilterIterator doesn't work as expected) 2016-04-19 10:59:10 +08:00
Dmitry Stogov e46be0cd19 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Prevent usage in GC after free.
2016-04-19 01:37:24 +03:00
Dmitry Stogov ffc697ac27 Prevent usage in GC after free. 2016-04-19 01:31:49 +03:00
Nikita Popov 73958ca62d Fix SEND_USER as well
Missed copy&paste code here
2016-04-18 22:45:38 +02:00
Nikita Popov a8792158bd Fix SEND_ARRAY+PREFER_REF SHM corruption
Make the behavior consistent between namespaced and not and with
PHP 5.6.
2016-04-18 18:26:20 +02:00
Xinchen Hui aa9f8e695c combine conditions 2016-04-18 19:13:54 +08:00
Bob Weinand b08bde185d Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-04-18 12:13:59 +02:00
Ferenc Kovacs 8f35ee49ee Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  mark frequent intermittent fpm test with XFAIL
2016-04-18 09:04:55 +02:00
Ferenc Kovacs 3a16f511d9 mark frequent intermittent fpm test with XFAIL 2016-04-18 09:04:27 +02:00
Ferenc Kovacs 50cfe0a15c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.21RC1
2016-04-18 08:15:47 +02:00
Ferenc Kovacs 6497d40521 prepare for 5.6.21RC1 2016-04-18 08:14:16 +02:00
Christopher Jones 3b54d93b2f Bump version in test 2016-04-18 11:15:01 +10:00
Nikita Popov d1a38743a5 Fix SEND_UNPACK array separation
Separating only immutable arrays is not enough.
2016-04-16 22:33:23 +02:00
Bob Weinand 6bb81d2c5f Fix non-/Zend tests too 2016-04-16 20:57:28 +02:00
Bob Weinand 15d1d4f45b Fixed bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice) 2016-04-16 20:36:19 +02:00
Dominic Luechinger 02766d0180 Adds new curl option CURLOPT_SSL_VERIFYSTATUS to enable OCSP verification 2016-04-16 18:30:19 +02:00
Anatol Belski fd6f7b8341 Add test for bug #72028 2016-04-16 16:11:22 +02:00
Nikita Popov d8590940a1 Use symtable lookup for arrays in array_column 2016-04-16 09:59:01 +02:00
Nikita Popov 28801bf249 Respect property visibility in array_column 2016-04-16 09:59:01 +02:00
Nikita Popov c0d8dc5bd7 Fixed bug #72031 2016-04-16 09:58:57 +02:00
Xinchen Hui 7e01c518b6 Fixed bug #72028 (pg_query_params(): NULL converts to empty string)
I don't have a pgsql server by hand, so no test script, but the fix must
be right.
2016-04-15 21:29:27 -07:00
Xinchen Hui 05d53dee7d Fixed bug #71972 (Cyclic references causing session_start(): Failed to decode session object) 2016-04-15 21:08:51 -07:00
Lior Kaplan edb569b439 Align NEWS entry format 2016-04-15 22:17:37 +03:00
Lior Kaplan 7d61d0712b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Align NEWS entry format
2016-04-15 22:09:05 +03:00
Lior Kaplan 5142bf27b2 Align NEWS entry format 2016-04-15 22:07:47 +03:00
Anatol Belski c0de35273a update NEWS 2016-04-15 13:41:09 +02:00
Anatol Belski d263616525 Fixed #71062 pg_convert() doesn't accept ISO 8601 for datatype timestamp 2016-04-15 13:38:49 +02:00
Xinchen Hui 163d26d584 Fixed failed with libedit 2016-04-15 11:57:53 +08:00
Xinchen Hui 8a17b1a241 Fixed bug #72014 (Including a file with anonymous classes multiple times leads to fatal error) 2016-04-14 20:21:19 +08:00
Christopher Jones ec358dac03 On second thoughts, keep this in sync with 5.6 for 71422 2016-04-14 15:49:15 +10:00
Christopher Jones 96ece22a05 Merge branch 'PHP-5.6' into PHP-7.0 2016-04-14 15:09:02 +10:00
Christopher Jones d1e81a59a7 Fix old comment cut-n-paste error 2016-04-14 15:08:42 +10:00
Christopher Jones 12cd25bb1a Fixed bug #71600 (oci_fetch_all segfaults when selecting more than 8 columns) (Tian Yang) 2016-04-14 14:09:16 +10:00
Christopher Jones cef4bc61c1 Merge fix for bug #71422. No code changed needed in PHP 7 2016-04-14 13:55:32 +10:00
Christopher Jones 8f2e6da806 Fixed bug #71422 (Fix ORA-01438: value larger than specified precision allowed for this column) 2016-04-14 13:50:01 +10:00
Christopher Jones be491a6b3b Merge branch 'PHP-7.0' of https://git.php.net/repository/php-src into PHP-7.0 2016-04-14 13:43:13 +10:00
Anatol Belski 8e6549c354 update NEWS 2016-04-12 19:37:36 +02:00
Anatol Belski e49580c96e Fixed bug #68849 bindValue is not using the right data type 2016-04-12 19:12:45 +02:00
Nikita Popov 4e585eb429 Fix ZEND_SEPARATE for by-val func returning ref zval 2016-04-12 14:44:29 +02:00
Nikita Popov 6a2eee520a Drop unnecessary ZEND_SEPARATE code
The following write ops will separate if necessary.
2016-04-12 14:44:29 +02:00
Joe Watkins b04125da85 phpdbg: close file handles 2016-04-12 13:40:03 +01:00
Remi Collet d62ab27042 fix skipif 2016-04-12 13:46:06 +02:00
Xinchen Hui 9458f54969 This only make sense on *nix 2016-04-12 15:31:21 +08:00
Anatol Belski 57ffb2bd80 prepare next 2016-04-12 06:49:30 +02:00
Anatol Belski a1e9de227d update NEWS 2016-04-11 15:37:45 +02:00
Anatol Belski 28b6f66a77 Fixed bug #70484 selectordinal doesn't work with named parameters 2016-04-11 15:01:22 +02:00
Anatol Belski f62943edc8 fix version macro to check 2016-04-11 15:01:22 +02:00
Joe Watkins c0b821d2e9 handle dummy frame 2016-04-11 13:24:37 +01:00
Joe Watkins 707941413d Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-04-11 08:04:14 +01:00
Joe Watkins 028485ae69 fix calendar segfault 2016-04-11 08:03:15 +01:00
Anatol Belski 190db69109 update NEWS 2016-04-10 19:10:45 +02:00
Anatol Belski b4ab0effc7 Fixed bug #71998 Function pg_insert does not insert when column type = inet 2016-04-10 18:48:35 +02:00
Anatol Belski 58ea2ad489 Fixed bug #65480 No declaration for msgformat_fix_quotes() in msgformat.c or msgformat_attr.c 2016-04-09 19:11:28 +02:00
Xinchen Hui fcbd95930c Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2016-04-09 10:02:20 -07:00
Xinchen Hui 5db4d9a71c Fixed bug #71995 (Returning the same var twice from __sleep() produces broken serialized data) 2016-04-09 10:01:04 -07:00
Anatol Belski e33c26659e update NEWS 2016-04-09 18:52:59 +02:00
Anatol Belski ef17343b3c Fixed bug #66289 Locale::lookup incorrectly returns en or en_US if locale is empty 2016-04-09 18:24:42 +02:00
Lior Kaplan c6c44c3629 Enable configure without opcache-file and huge-code-pages
This doesn't chagne the default (yes for both features), but respects
--disable-opcache-file and --disable-huge-code-pages configure flags if given.
2016-04-09 15:57:57 +03:00
Lior Kaplan 403c3f95fe Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  opcache config.m4: Use = for comparison
2016-04-09 01:35:30 +03:00
Lior Kaplan c1f597d9a1 opcache config.m4: Use = for comparison 2016-04-08 22:38:07 +03:00
Anatol Belski 73815573e0 fix indent 2016-04-08 14:17:57 +02:00
Anatol Belski f691fe343c update NEWS 2016-04-08 13:51:29 +02:00
Anatol Belski 45d9efaac3 fix compat for ICU < 50 2016-04-08 12:48:26 +02:00
Anatol Belski 1541a55a4f Fixed bug #68893 Stackoverflow in datefmt_create 2016-04-08 12:31:19 +02:00
Daniel Persson f7600e17cb Added missing newline. 2016-04-08 12:31:19 +02:00
Daniel Persson 0030fa322f Changed to check for error with the new function that returns null if error is set 2016-04-08 12:31:19 +02:00
Daniel Persson e3b160bf86 Added function to check error and return null if error is set. 2016-04-08 12:31:19 +02:00
Daniel Persson ff2af89519 Added tests for bug 70451 and 70452 2016-04-08 12:31:19 +02:00
Xinchen Hui c45f7b97a3 Fixed bug #71986 (Nested foreach assign-by-reference creates broken variables) 2016-04-08 17:57:51 +08:00
Anatol Belski 94e889299b update NEWS 2016-04-08 11:01:42 +02:00
Anatol Belski 93f8eaf3b8 Fixed bug #70455 Missing constant: IntlChar::NO_NUMERIC_VALUE 2016-04-08 09:55:57 +02:00
Anatol Belski f042c5f726 update NEWS 2016-04-08 09:28:41 +02:00
Anatol Belski 49d31fa01d Fixed bug #71516 IntlDateFormatter losts locale if pattern is set via constructor 2016-04-08 08:59:43 +02:00
Xinchen Hui d242a8fb68 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fixed bug #71980
2016-04-07 19:29:49 +08:00
Xinchen Hui c85907682a Improved fix for #71940 2016-04-07 19:28:54 +08:00
Nikita Popov aad4ecebf8 Fixed bug #71980 2016-04-07 12:29:59 +02:00
Xinchen Hui 079239a7ce Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Remove __halt_compiler from semi-reserved tokens
  Fixed Bug #71974 Trans sid will always be send, even if cookies are available
  Optimized array_fill(). This is a perfect function for fast creation of packed arrays.
  Fixed build
  fix merge mistake
  fix tests
  PostgreSQL's PDOStatement::getColumnMeta() fills in table's name.
  fix indent
  Fixed bug #71978 (Existence of return type hint affects other compatibility rules)
  fix test
  fix bug #71667 (emulate how mssql extension names "computed" columns)
  update NEWS
  add 32-bit specific variont for #62498
  skip test on 32-bit
  make opcache lockfile path configurable
  return zvals instead of strings, cast or not based on stringify attribute
  fix test
  add skip slow test
2016-04-07 13:58:00 +08:00
Xinchen Hui 7e042224a2 Fixed bug #71940 (Unserialize crushes on restore object reference) 2016-04-07 13:56:55 +08:00
Nikita Popov 5ab950cb2c Remove __halt_compiler from semi-reserved tokens
token_get_all() is not capable of dealing with this one correctly.
2016-04-07 05:52:32 +02:00
Yasuo Ohgaki 6467a4eb36 Fixed Bug #71974 Trans sid will always be send, even if cookies are available 2016-04-07 10:26:05 +09:00
Dmitry Stogov b31240f995 Optimized array_fill(). This is a perfect function for fast creation of packed arrays. 2016-04-07 01:01:11 +03:00
Dmitry Stogov 088f55ae74 Fixed build 2016-04-07 00:59:21 +03:00
Anatol Belski 6489edb958 fix merge mistake 2016-04-06 18:05:39 +02:00
Anatol Belski 26f9aa7211 fix tests 2016-04-06 17:43:49 +02:00
Petr Sýkora aeb9c81c09 PostgreSQL's PDOStatement::getColumnMeta() fills in table's name. 2016-04-06 17:43:49 +02:00
Anatol Belski 052c1d337c fix indent 2016-04-06 17:43:49 +02:00
Dmitry Stogov e9d65160e8 Fixed bug #71978 (Existence of return type hint affects other compatibility rules) 2016-04-06 17:17:10 +03:00
Anatol Belski ea64d290fe fix test 2016-04-06 14:44:23 +02:00
Adam Baratz ed3edc2f05 fix bug #71667 (emulate how mssql extension names "computed" columns) 2016-04-06 14:41:55 +02:00
Anatol Belski c256a8c25e update NEWS 2016-04-06 14:13:43 +02:00
Anatol Belski 4f7d89a335 add 32-bit specific variont for #62498 2016-04-06 14:05:25 +02:00
Anatol Belski 02fc9cb31f skip test on 32-bit
The Postgres INT8 datatype is handled as string on 32-bit
2016-04-06 13:55:32 +02:00
Fatih ACAR d54eafb349 make opcache lockfile path configurable
Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Baptiste Daroussin <baptiste.daroussin@gandi.net>
Signed-off-by: Fatih Acar <fatih.acar@gandi.net>
2016-04-06 13:29:52 +02:00
Adam Baratz 1e1500a2bc return zvals instead of strings, cast or not based on stringify attribute 2016-04-06 12:18:53 +02:00
Anatol Belski 354a682c38 fix test 2016-04-06 08:21:10 +02:00
Anatol Belski fd9137c00c add skip slow test 2016-04-06 08:18:32 +02:00
Xinchen Hui 4e1d435bd1 Fixed order 2016-04-06 10:21:05 +08:00
Xinchen Hui e95782ed5e Fixed bug #71969 (str_replace returns an incorrect resulting array after a foreach by reference) 2016-04-06 10:19:24 +08:00
Anatol Belski 6ae3915eee update NEWS 2016-04-05 18:21:25 +02:00
Adam Baratz 8a92fed532 Add driver-specific attributes for controlling calls to dbsetlogintime() and dbsettime() 2016-04-05 18:18:37 +02:00
Anatol Belski df8f927446 update NEWS 2016-04-05 15:12:12 +02:00
Anatol Belski c2cb4664bc fix and extend test 2016-04-05 15:06:17 +02:00
Joe Bylund e10257ba80 Don't roundtrip to the database to get the column type if you already know it
add_assoc_string now takes just three args

nikic's fix to move pqclear outside the if, would be a possible memory leak inside the if

(joe) check behavior of getColumnMeta
2016-04-05 15:03:04 +02:00
DQNEO ea0598962f remove description for apache 1.3 2016-04-05 12:13:38 +02:00
Anatol Belski dedc9a4200 update NEWS 2016-04-05 11:55:36 +02:00
Anatol Belski bbaa868c29 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-04-05 11:55:03 +02:00
Anatol Belski 5ed05bc686 update NEWS 2016-04-05 11:52:53 +02:00
Anatol Belski d10a8e4804 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Use STR_EMPTY_ALLOC macro instead
  Fix DateInterval::format segfault
2016-04-05 11:24:23 +02:00
Thomas Punt 1aea777349 Use STR_EMPTY_ALLOC macro instead 2016-04-05 11:18:14 +02:00
Thomas Punt 40f14bad33 Fix DateInterval::format segfault 2016-04-05 11:18:14 +02:00
Matteo Beccati 4090e709aa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71447 (Quotes inside comments not properly handled)
  Fixed a few PDO tests to conform to PDO Common standards
  news entry #69537
  Fix #69537: __debugInfo with empty string for key gives error

Conflicts:
	Zend/zend_compile.c
2016-04-05 00:07:02 +02:00
Matteo Beccati 30925cd498 Fixed bug #71447 (Quotes inside comments not properly handled) 2016-04-04 23:50:28 +02:00
Matteo Beccati 9a87108eca Fixed a few PDO tests to conform to PDO Common standards 2016-04-04 23:43:17 +02:00
Anatol Belski d2948d4b71 update NEWS 2016-04-04 17:42:06 +02:00
Adam Baratz 9fcfc18ca9 Fix #71943: dblib_handle_quoter needs to allocate an extra byte 2016-04-04 17:33:49 +02:00
Joe Watkins 9a65c69c62 news entry #71428 2016-04-04 10:30:23 +01:00
Joe Watkins 0797cfdda9 news entry #69537 2016-04-04 10:23:19 +01:00
Joe Watkins cd038cc5eb news entry #69537 2016-04-04 10:22:13 +01:00
Joe Watkins 922a4048e4 news entry 71609 2016-04-04 10:20:26 +01:00
Joe Watkins 4d5bb45b3b magical notation is magical 2016-04-04 09:33:20 +01:00
Joe Watkins 860c55466e move this to standard [ci skip] 2016-04-04 09:26:17 +01:00
Joe Watkins c1dec143d6 news updates 2016-04-04 09:21:06 +01:00
Joe Watkins 9a38b2dbce Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-04-03 12:41:23 +01:00
Joe Watkins 14e4c610e9 Fix #69537: __debugInfo with empty string for key gives error 2016-04-03 12:40:29 +01:00
Joe Watkins 91c10662c8 fix #69537: __debugInfo with empty string for key gives error 2016-04-03 12:38:25 +01:00
Elizabeth Marie Smith 4df5f79ab5 Fix ODBC bug for varchars returning with length zero 2016-04-01 17:11:58 +02:00
Xinchen Hui 5b1bb41c0b Fixed bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1' failed) 2016-04-01 22:27:29 +08:00
Joe Watkins 034e8ec02e fix #71287 (substr_replace bug when length type is string) 2016-03-31 17:10:12 +01:00
Julien Pauli 8a4d164c2b Typo in NEWS 2016-03-31 17:45:07 +02:00
Joe Watkins d9e4510224 remove unused params || woops 2016-03-31 12:51:00 +01:00
Joe Watkins 3b13206aa9 Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-03-31 12:40:15 +01:00
Joe Watkins 233115ea23 fix #71609: Segmentation fault on ZTS with gethostbyname 2016-03-31 12:39:01 +01:00
Anatol Belski e6bb7eb3aa Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix borked mainstream patch
  5.5.35 now
2016-03-31 01:38:22 +02:00
Anatol Belski a00c2b1bf5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix borked mainstream patch
  5.5.35 now
2016-03-31 01:36:47 +02:00
Anatol Belski 4b0b1cec00 fix borked mainstream patch 2016-03-31 01:33:38 +02:00
Anatol Belski 9dc6c33740 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test to not to cause false positives
2016-03-31 01:30:23 +02:00
Anatol Belski ed707a5217 fix test to not to cause false positives 2016-03-31 01:29:05 +02:00
Lior Kaplan 3b26af59d4 Align NEWS entry format 2016-03-31 01:01:11 +03:00
Lior Kaplan 53ce826cdd Merge branch 'PHP-5.6' into PHP-7.0 2016-03-31 00:54:43 +03:00
Lior Kaplan cef40c0c3f Align NEWS entry format 2016-03-31 00:52:53 +03:00
Nikita Popov b1e854f776 Fix bug #71334
Always duplicate the array before doing a sort with user-defined
comparison function, to avoid access to the intermediate
inconsistent state.

I've also dropped the "array modification" warning, as protection
against modifications is no longer relevant if we're always working
on a copy anyway.

This also required some changes to how SplArray forwards calls to
sorting functions.
2016-03-30 22:49:27 +02:00
Ferenc Kovacs 1866ab2d1e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-03-30 22:29:00 +02:00
Ferenc Kovacs abd59c0e40 update NEWS 2016-03-30 22:28:28 +02:00
Nikita Popov f95679885f Fix __invoke comparison in closure_get_method
It compared against the wrong variable. Fixed this by getting rid
of lc_name entirely and use equals_literal_ci instead.
2016-03-30 18:32:00 +02:00
Matteo Beccati 3bfe1c55ae Removed shmop test leaking an shm segment 2016-03-30 10:00:28 +02:00
Nikita Popov ed06d130f7 Fixed bug #71922 2016-03-29 19:29:19 +02:00
Julien Pauli f0120ff878 5.5.35 now 2016-03-29 18:11:03 +02:00
Anatol Belski c7f7139985 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix dir separator in test
2016-03-29 14:20:30 +02:00
Anatol Belski 23d0065744 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix dir separator in test
2016-03-29 14:19:35 +02:00
Anatol Belski 551423c642 fix dir separator in test 2016-03-29 14:18:25 +02:00
Anatol Belski dd0a96ae70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
  Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
2016-03-29 13:12:47 +02:00
Anatol Belski 5272184a1e Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
The actual fix is applying the upstream patch from
https://github.com/file/file/commit/6713ca45e7757297381f4b4cdb9cf5e624a9ad36
2016-03-29 13:11:25 +02:00
Anatol Belski 84990ab346 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
2016-03-29 13:11:17 +02:00
Anatol Belski fe13566c93 Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
The actual fix is applying the upstream patch from
https://github.com/file/file/commit/6713ca45e7757297381f4b4cdb9cf5e624a9ad36
2016-03-29 13:10:39 +02:00
Joe Watkins 5074fd9c7c Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-03-29 11:34:58 +01:00
Joe Watkins d12ed0c7fa remove unused param 2016-03-29 11:34:18 +01:00
Anatol Belski 3b08638340 update NEWS 2016-03-29 12:05:36 +02:00
Xinchen Hui f5bdc137fb Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  Updated to version 2016.3 (2016c)
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
  Fix bug #71798 - Integer Overflow in php_raw_url_encode
  update NEWS
  Disable huge pages in the Zend allocator by default As per the discussion on internals, this is an expert feature that needs special system-level configuration and care.
  Added ability to disable huge pages in Zend Memeory Manager through the environment variable USE_ZEND_ALLOC_HUGE_PAGES=0.
  Fix bug #71860: Require valid paths for phar filenames
  Fix bug #71860: Require valid paths for phar filenames
  update NEWS
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
  Merge branch 'PHP-5.6' into PHP-7.0
  Updated to version 2016.2 (2016b)
  update libs versions
  set RC1 versions
  Going for 5.5.34
2016-03-29 18:02:00 +08:00
Xinchen Hui 256593abcf Update tests 2016-03-29 17:52:58 +08:00
Anatol Belski f2ca3c6036 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
2016-03-29 11:26:09 +02:00
Anatol Belski 6afa41cf80 Merge remote-tracking branch 'origin/PHP-7.0.5' into PHP-7.0
* origin/PHP-7.0.5:
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  Updated to version 2016.3 (2016c)
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  Fixed bug #71527 Buffer over-write in finfo_open with malformed magic file
  Fix bug #71798 - Integer Overflow in php_raw_url_encode
  update NEWS
  Disable huge pages in the Zend allocator by default As per the discussion on internals, this is an expert feature that needs special system-level configuration and care.
  Added ability to disable huge pages in Zend Memeory Manager through the environment variable USE_ZEND_ALLOC_HUGE_PAGES=0.
  Fix bug #71860: Require valid paths for phar filenames
  Fix bug #71860: Require valid paths for phar filenames
  update NEWS
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
  Merge branch 'PHP-5.6' into PHP-7.0
  Updated to version 2016.2 (2016b)
  update libs versions
  set RC1 versions
  Going for 5.5.34
2016-03-29 11:24:33 +02:00
Xinchen Hui 2e6d70787c Fixed bug #71914 (Reference is lost in "switch") 2016-03-29 17:14:36 +08:00
Joe Watkins dd70c39556 fix bug #71428: Validation type inheritance with = NULL 2016-03-29 09:57:51 +01:00
Joe Watkins 3f56dfe866 Bug #71428 work ... hopefully, fix drupal 8 2016-03-29 09:36:08 +01:00
Stanislav Malyshev cc7631dd08 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
2016-03-28 23:45:15 -07:00
Stanislav Malyshev a18b1f74fa Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
2016-03-28 23:30:14 -07:00
Stanislav Malyshev 62da5cdf3d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  Fix bug #71798 - Integer Overflow in php_raw_url_encode
  Fix bug #71860: Require valid paths for phar filenames
  Going for 5.5.34

Conflicts:
	configure.in
	ext/phar/tests/create_path_error.phpt
	main/php_version.h
2016-03-28 23:21:15 -07:00
Joe Watkins ee9a78a033 work on #71428 2016-03-28 11:54:25 +01:00
Joe Watkins 28f66763a4 fix #70189 (SAPI sends empty Content-Type when default_mimetype is empty) 2016-03-27 06:50:11 +01:00
Joe Watkins 32df2210d7 my commits are bad, and I feel bad (test for bug #71414) 2016-03-26 23:59:46 +00:00
Joe Watkins 4327370d13 fix #71414 (Interface method override inherited method and implemented in a trait causes fatal error) 2016-03-26 23:47:31 +00:00
Joe Watkins 1a75cd29a2 add test for bug 2016-03-26 11:15:08 +00:00
Joe Watkins 373da7aa6f fix standard object handler for properties when type == BP_VAR_IS 2016-03-26 11:15:08 +00:00
Nikita Popov bd90f5507f Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/crypt.c
2016-03-25 20:23:04 +01:00
Nikita Popov 54da966883 Fixed bug #67512 2016-03-25 20:18:46 +01:00
Xinchen Hui 1929fc9b16 Fixed bug #71891 (header_register_callback() and register_shutdown_function())
Actually, this fixed the memleak not the behavior(it is expected
behavior that "shutdown" is not outputed)
2016-03-25 12:34:22 +08:00
Derick Rethans 70878a92b1 Updated to version 2016.3 (2016c) 2016-03-24 11:09:07 +00:00
Derick Rethans 35b19d8dcc Empty merge 2016-03-24 11:09:06 +00:00
Derick Rethans c4681ec8e1 Updated to version 2016.3 (2016c) 2016-03-24 11:09:05 +00:00
Anatol Belski d6eff6655c update NEWS 2016-03-23 12:32:16 +01:00
Xinchen Hui a3946de339 Fixed Bug #71884 (Null pointer deref (segfault) in stream_context_get_default) 2016-03-23 16:16:26 +08:00
Anatol Belski 241ba9dcb1 if there's no JIT support, no RINIT is really needed 2016-03-22 21:42:21 +01:00
Rasmus Lerdorf 1efcdaf092 Disable huge pages in the Zend allocator by default
As per the discussion on internals, this is an expert feature
that needs special system-level configuration and care.
2016-03-22 08:04:53 -07:00
Xinchen Hui b49ec68134 Update test script 2016-03-22 11:28:19 +08:00
Nikita Popov dc842bbf8d Fixed bug #71871 2016-03-21 22:49:18 +01:00
Anatol Belski e988239634 decrease the default PCRE JIT stack to 64K 2016-03-21 18:59:39 +01:00
Anatol Belski e23a41225f Increase PCRE JIT stack size
It is done by implementing the custom stack usage. This makes the
JIT with mode on more compatible with the JIT mode off. Until now, the
default PCRE JIT stack was used which is 32kb big by default. There
are situations where some patterns would fail with JIT while working
correctly without JIT.

The starting size of the JIT stack is still set to 32kb, while the
max is set to the permissive 256kb (and can be increased up to 1mb).
As until now no suchlike bugs regarding JIT were reported, it is expected,
that the stack usage will stay by 32kb in most cases. Though providing
the custom stack, applications will have more room for some sporadic
stack increase, thus more compatibility.
2016-03-21 17:31:26 +01:00
Julien Pauli cb240fe711 Updated NEWS 2016-03-21 15:40:01 +01:00
Julien Pauli 5ba7b9af1b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Reworked Fix bug #52098
  Fix bug #52098

Conflicts:
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
2016-03-21 15:39:48 +01:00
Julien Pauli abbe1551d6 Updated NEWS 2016-03-21 15:26:21 +01:00
Julien Pauli d3d64b7c62 Reworked Fix bug #52098 2016-03-21 15:23:18 +01:00
Daniel Persson e541cd8e6b Fix bug #52098 2016-03-21 15:04:11 +01:00
Xinchen Hui d26ca89402 array_dup should not copy the nApplyCount 2016-03-21 19:19:05 +08:00
Xinchen Hui 9712a974be Also protects object to array cast 2016-03-21 19:12:50 +08:00
Xinchen Hui a9a46f17be Update NEWS 2016-03-21 16:44:30 +08:00
Xinchen Hui ead0dfc3c9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS for efacdc3
  FIX #71831: CURLOPT_NOPROXY applied as long instead of string
2016-03-21 16:43:55 +08:00
Xinchen Hui c9c8e70463 Update NEWS for efacdc3 2016-03-21 16:43:30 +08:00
Xinchen Hui 056459dc9d Merge branch 'PHP-5.6' of https://github.com/msierks/php-src into PHP-5.6
* 'PHP-5.6' of https://github.com/msierks/php-src:
  FIX #71831: CURLOPT_NOPROXY applied as long instead of string
2016-03-21 16:39:22 +08:00
Xinchen Hui 65ae7440b0 Merge branch 'bug71835' of https://github.com/bukka/php-src into PHP-7.0
* 'bug71835' of https://github.com/bukka/php-src:
  Fix bug #71835 (json_encode sometimes incorrectly detects recursion with JsonSerializable)
2016-03-21 16:03:16 +08:00
Stanislav Malyshev c4517b2a5e Fix bug #71750: use zend_string_safe_alloc for calculated allocations 2016-03-20 22:39:17 -07:00
Stanislav Malyshev 28a6ed9f9a Fix bug #71735: Double-free in SplDoublyLinkedList::offsetSet 2016-03-20 22:29:08 -07:00
Nikita Popov f3309173f9 Fixed bug #62059 2016-03-20 18:17:44 +01:00
Nikita Popov 12f2665df8 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_observer.c
2016-03-20 17:48:06 +01:00
Nikita Popov cc3cdd0057 Fixed bug #67582 2016-03-20 17:46:12 +01:00
Jakub Zelenka 7e069daa89 Fix bug #71835 (json_encode sometimes incorrectly detects recursion with JsonSerializable) 2016-03-20 15:56:27 +00:00
Nikita Popov a175aa9dca Fixed bug #71731
The read_dimension() handler in BP_VAR_IS mode will now call
offsetExists() before caling offsetGet(). This has always been a
problem, however recently the issue has been exacerbated, because
the null-coalesce operator ?? makes it visible for non-nested
array accesses.

Also fixes #69659.
2016-03-20 13:35:00 +01:00
Nikita Popov 1f6d27d3d2 Fix use of UNDEF instead of NULL in read_dimension 2016-03-20 13:33:17 +01:00
Xinchen Hui 9564998e49 Fixed Bug #71859 (zend_objects_store_call_destructors operates on realloced memory, crashing) 2016-03-20 04:52:57 -07:00
Nikita Popov 8023204d21 Fixed bug #52339
Autoloader 101: Don't throw if you fail. PHP will throw for you.
2016-03-18 20:28:58 +01:00
Nikita Popov a2522efa9f Add extra ArrayObject::sort() test 2016-03-18 19:59:08 +01:00
Nikita Popov 094c808374 Fix bug #71838 2016-03-18 19:58:52 +01:00
Nikita Popov fd95555107 Fix ZEND_DEBUG condition 2016-03-18 19:31:34 +01:00
Michael Sierks efacdc3511 FIX #71831: CURLOPT_NOPROXY applied as long instead of string
The CURLOPT_NOPROXY option value is converted to a long before
being applied as a curl option. This causes the option to have
no effect. This patch changes this conversion to a string.
2016-03-18 07:29:01 -05:00
Dmitry Stogov 69c9be5c99 typo 2016-03-18 10:27:46 +03:00
Dmitry Stogov 11594e86b8 typo 2016-03-18 10:25:48 +03:00
Xinchen Hui 5b8d0dc6ae Fixed pdo_stmt.c: zval* being passed into zend_parse_parameters_ex 2016-03-18 11:50:03 +08:00
Dmitry Stogov 945a661912 Added ability to disable huge pages in Zend Memeory Manager through the environment variable USE_ZEND_ALLOC_HUGE_PAGES=0. 2016-03-17 22:43:42 +03:00
Anatol Belski 28b6f0232b fix and update NEWS 2016-03-17 19:04:56 +01:00
Anatol Belski d529c3358c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix and update NEWS
2016-03-17 19:03:46 +01:00
Anatol Belski b8c9c92d44 fix and update NEWS 2016-03-17 19:02:08 +01:00
Xinchen Hui a2ca4558b5 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0 2016-03-17 07:57:22 -07:00
Anatol Belski ef8d6435a2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Backport patch for bug #71820
2016-03-17 15:55:37 +01:00
Xinchen Hui 93499bfd8a Fixed test & ZEND_BOOL should result TMP_VAR 2016-03-17 07:55:25 -07:00
Xinchen Hui 345ecd9822 Fixed #71837 (Wrong arrays behaviour) 2016-03-17 07:41:41 -07:00
Anatol Belski 1b632cfe83 Backport patch for bug #71820
Rev b4eedd128b
2016-03-17 14:28:58 +01:00
Xinchen Hui eb405623ec Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:/php-src:
  fix NEWS
  NEWS
  Fix Bug #63171 	Script hangs after max_execution_time
2016-03-17 21:27:23 +08:00
Xinchen Hui 383dde5b15 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  fix NEWS
  NEWS
  NEWS
  Fix Bug #63171 	Script hangs after max_execution_time
  Fixed bug #71820 pg_fetch_object bind parameters before call constructor
2016-03-17 21:26:14 +08:00
Xinchen Hui 910e6dc6b8 Fixed for master 2016-03-17 21:10:08 +08:00
Remi Collet e7f74a3f9b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix NEWS
2016-03-17 13:53:52 +01:00
Remi Collet b5b1ba850a fix NEWS 2016-03-17 13:53:42 +01:00
Remi Collet 9073208f6c NEWS 2016-03-17 13:44:28 +01:00
Remi Collet 2291ebc0ea Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  NEWS
  Fix Bug #63171 	Script hangs after max_execution_time
2016-03-17 13:42:34 +01:00
Remi Collet d513b4cde5 NEWS 2016-03-17 13:40:42 +01:00
Remi Collet 407ad28ae5 Fix Bug #63171 Script hangs after max_execution_time
If aborted via timer expiration, don't try to call any unixODBC function
which may hangs because of internal locks
2016-03-17 13:38:45 +01:00
Xinchen Hui aef22ac1c1 Remove unnecessary pattern 2016-03-17 20:21:36 +08:00
Xinchen Hui 041a01fd6c Fixed for PHP7 2016-03-17 20:20:01 +08:00
Xinchen Hui 820b0aa2ab Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER)
2016-03-17 19:54:33 +08:00
Xinchen Hui 8e2f658f49 Fixed bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER) 2016-03-17 19:54:19 +08:00
Anatol Belski b4eedd128b Fixed bug #71820 pg_fetch_object bind parameters before call constructor
If we want to fetch into an object of a custom class that implemens
__set handler, the corstructor has to be called first. The data
passed to the constructor can be possibly required in __set handler.
2016-03-17 12:41:55 +01:00
Xinchen Hui dae086040e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test script
2016-03-17 17:07:07 +08:00
Xinchen Hui 6d4aec029a Fixed test script 2016-03-17 17:06:56 +08:00
Xinchen Hui e12456603a Remove typo 2016-03-17 15:27:36 +08:00
Xinchen Hui b8f0cb063f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test script
2016-03-17 15:23:53 +08:00
Xinchen Hui ead7632cf9 Fixed test script 2016-03-17 15:23:44 +08:00
Xinchen Hui 47f3b3df45 Update NEWS 2016-03-17 15:23:21 +08:00
Xinchen Hui fe1a3fc08b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71841 (EG(error_zval) is not handled well)
  Fixed bug #71840 (Unserialize accepts wrongly data)

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/standard/var_unserializer.c
2016-03-17 15:22:44 +08:00
Xinchen Hui 5546f8be56 Fixed bug #71841 (EG(error_zval) is not handled well) 2016-03-17 15:16:47 +08:00
Xinchen Hui 6f241f5fad Fixed bug #71840 (Unserialize accepts wrongly data) 2016-03-17 15:15:28 +08:00
Ferenc Kovacs fba1c7629c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.20RC1
2016-03-17 01:47:37 +01:00
Ferenc Kovacs 14f4848fb0 prepare for 5.6.20RC1 2016-03-17 01:46:00 +01:00
Andrey Hristov fa4addd409 More email fixing 2016-03-16 10:54:56 +01:00
Andrey Hristov f2ab731a8c Fix emails in headers. @mysql.com addresses are no more since many years. 2016-03-16 10:24:52 +01:00
Remi Collet 46293ed6d4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #ifdef usage
2016-03-16 07:18:09 +01:00
Remi Collet 478c807128 fix #ifdef usage 2016-03-16 07:17:49 +01:00
Derick Rethans ba71144b8c Updated to version 2016.2 (2016b) 2016-03-15 09:14:11 +00:00
Derick Rethans a1c6481c63 Empty merge 2016-03-15 09:14:10 +00:00
Derick Rethans ddc62f2e8b Updated to version 2016.2 (2016b) 2016-03-15 09:14:09 +00:00
Anatol Belski ba5b98db8c update libs versions 2016-03-15 09:44:05 +01:00
Anatol Belski 6ec7ef39f4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs versions
2016-03-15 09:43:08 +01:00
Anatol Belski 73b9941622 update libs versions 2016-03-15 09:41:34 +01:00
Anatol Belski 2921c0e3f6 prepare next 2016-03-15 08:24:41 +01:00
444 changed files with 13152 additions and 5612 deletions

No files matched your search

-204
View File
@@ -5,7 +5,6 @@ Installing PHP
* General Installation Considerations
* Installation on Unix systems
+ Apache 1.3.x on Unix systems
+ Apache 2.x on Unix systems
+ Lighttpd 1.4 on Unix systems
+ Sun, iPlanet and Netscape servers on Sun Solaris
@@ -103,7 +102,6 @@ Installation on Unix systems
Table of Contents
* Apache 1.3.x on Unix systems
* Apache 2.x on Unix systems
* Lighttpd 1.4 on Unix systems
* Sun, iPlanet and Netscape servers on Sun Solaris
@@ -163,208 +161,6 @@ Table of Contents
you can't figure out why, see the Problems section.
__________________________________________________________________
Apache 1.3.x on Unix systems
This section contains notes and hints specific to Apache installs of
PHP on Unix platforms. We also have instructions and notes for Apache 2
on a separate page.
You can select arguments to add to the configure on line 10 below from
the list of core configure options and from extension specific options
described at the respective places in the manual. The version numbers
have been omitted here, to ensure the instructions are not incorrect.
You will need to replace the 'xxx' here with the correct values from
your files.
Example #1 Installation Instructions (Apache Shared Module Version) for
PHP
1. gunzip apache_xxx.tar.gz
2. tar -xvf apache_xxx.tar
3. gunzip php-xxx.tar.gz
4. tar -xvf php-xxx.tar
5. cd apache_xxx
6. ./configure --prefix=/www --enable-module=so
7. make
8. make install
9. cd ../php-xxx
10. Now, configure your PHP. This is where you customize your PHP
with various options, like which extensions will be enabled. Do a
./configure --help for a list of available options. In our example
we'll do a simple configure with Apache 1 and MySQL support. Your
path to apxs may differ from our example.
./configure --with-mysql --with-apxs=/www/bin/apxs
11. make
12. make install
If you decide to change your configure options after installation,
you only need to repeat the last three steps. You only need to
restart apache for the new module to take effect. A recompile of
Apache is not needed.
Note that unless told otherwise, 'make install' will also install PEAR,
various PHP tools such as phpize, install the PHP CLI, and more.
13. Setup your php.ini file:
cp php.ini-development /usr/local/lib/php.ini
You may edit your .ini file to set PHP options. If you prefer your
php.ini in another location, use --with-config-file-path=/some/path in
step 10.
If you instead choose php.ini-production, be certain to read the list
of changes within, as they affect how PHP behaves.
14. Edit your httpd.conf to load the PHP module. The path on the right hand
side of the LoadModule statement must point to the path of the PHP
module on your system. The make install from above may have already
added this for you, but be sure to check.
LoadModule php7_module libexec/libphp7.so
15. And in the AddModule section of httpd.conf, somewhere under the
ClearModuleList, add this:
AddModule mod_php7.c
16. Tell Apache to parse certain extensions as PHP. For example,
let's have Apache parse the .php extension as PHP. You could
have any extension(s) parse as PHP by simply adding more, with
each separated by a space. We'll add .phtml to demonstrate.
AddType application/x-httpd-php .php .phtml
It's also common to setup the .phps extension to show highlighted PHP
source, this can be done with:
AddType application/x-httpd-php-source .phps
17. Use your normal procedure for starting the Apache server. (You must
stop and restart the server, not just cause the server to reload by
using a HUP or USR1 signal.)
Alternatively, to install PHP as a static object:
Example #2 Installation Instructions (Static Module Installation for
Apache) for PHP
1. gunzip -c apache_1.3.x.tar.gz | tar xf -
2. cd apache_1.3.x
3. ./configure
4. cd ..
5. gunzip -c php-5.x.y.tar.gz | tar xf -
6. cd php-5.x.y
7. ./configure --with-mysql --with-apache=../apache_1.3.x
8. make
9. make install
10. cd ../apache_1.3.x
11. ./configure --prefix=/www --activate-module=src/modules/php7/libphp7.a
(The above line is correct! Yes, we know libphp7.a does not exist at this
stage. It isn't supposed to. It will be created.)
12. make
(you should now have an httpd binary which you can copy to your Apache bin d
ir if
it is your first install then you need to "make install" as well)
13. cd ../php-5.x.y
14. cp php.ini-development /usr/local/lib/php.ini
15. You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
AddType application/x-httpd-php .php
Depending on your Apache install and Unix variant, there are many
possible ways to stop and restart the server. Below are some typical
lines used in restarting the server, for different apache/unix
installations. You should replace /path/to/ with the path to these
applications on your systems.
Example #3 Example commands for restarting Apache
1. Several Linux and SysV variants:
/etc/rc.d/init.d/httpd restart
2. Using apachectl scripts:
/path/to/apachectl stop
/path/to/apachectl start
3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:
/path/to/httpsdctl stop
/path/to/httpsdctl start
4. Using mod_ssl, or another SSL server, you may want to manually
stop and start:
/path/to/apachectl stop
/path/to/apachectl startssl
The locations of the apachectl and http(s)dctl binaries often vary. If
your system has locate or whereis or which commands, these can assist
you in finding your server control programs.
Different examples of compiling PHP for apache are as follows:
./configure --with-apxs --with-pgsql
This will create a libphp7.so shared library that is loaded into Apache
using a LoadModule line in Apache's httpd.conf file. The PostgreSQL
support is embedded into this library.
./configure --with-apxs --with-pgsql=shared
This will create a libphp7.so shared library for Apache, but it will
also create a pgsql.so shared library that is loaded into PHP either by
using the extension directive in php.ini file or by loading it
explicitly in a script using the dl() function.
./configure --with-apache=/path/to/apache_source --with-pgsql
This will create a libmodphp7.a library, a mod_php7.c and some
accompanying files and copy this into the src/modules/php7 directory in
the Apache source tree. Then you compile Apache using
--activate-module=src/modules/php7/libphp7.a and the Apache build
system will create libphp7.a and link it statically into the httpd
binary. The PostgreSQL support is included directly into this httpd
binary, so the final result here is a single httpd binary that includes
all of Apache and all of PHP.
./configure --with-apache=/path/to/apache_source --with-pgsql=shared
Same as before, except instead of including PostgreSQL support directly
into the final httpd you will get a pgsql.so shared library that you
can load into PHP from either the php.ini file or directly using dl().
When choosing to build PHP in different ways, you should consider the
advantages and drawbacks of each method. Building as a shared object
will mean that you can compile apache separately, and don't have to
recompile everything as you add to, or change, PHP. Building PHP into
apache (static method) means that PHP will load and run faster. For
more information, see the Apache » web page on DSO support.
Note:
Apache's default httpd.conf currently ships with a section that
looks like this:
User nobody
Group "#-1"
Unless you change that to "Group nogroup" or something like that
("Group daemon" is also very common) PHP will not be able to open
files.
Note:
Make sure you specify the installed version of apxs when using
--with-apxs=/path/to/apxs . You must NOT use the apxs version that
is in the apache sources but the one that is actually installed on
your system.
__________________________________________________________________
__________________________________________________________________
Apache 2.x on Unix systems
This section contains notes and hints specific to Apache 2.x installs
+434 -17
View File
@@ -1,9 +1,400 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 Mar 2016 PHP 7.0.5RC1
21 Jul 2016 PHP 7.0.9
- CLI Server:
. Fixed bug #69953 (Support MKCALENDAR request method). (Christoph)
- Core:
. Fixed bug #72508 (strange references after recursive function call and
"switch" statement). (Laruence)
. Fixed bug #72513 (Stack-based buffer overflow vulnerability in
virtual_file_ex). (Stas)
. Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries
and applications). (Stas)
- bz2:
. Fixed bug #72613 (Inadequate error handling in bzread()). (Stas)
- CLI:
. Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify
router.php). (Laruence)
- COM:
. Fixed bug #72498 (variant_date_from_timestamp null dereference). (Anatol)
- Curl:
. Fixed bug #72541 (size_t overflow lead to heap corruption). (Stas)
- Exif:
. Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE).
(Stas)
. Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment).
(Stas)
- GD:
. Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb)
. Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb)
. Fixed bug #64641 (imagefilledpolygon doesn't draw horizontal line). (cmb)
. Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read
access). (Pierre)
. Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre)
. Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()).
(Pierre)
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
overflow). (Pierre)
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
- Intl:
. Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas)
- Mbstring:
. Fixed bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) -
oob read access). (Laruence)
. Fixed bug #72399 (Use-After-Free in MBString (search_re)). (Laruence)
- mcrypt:
. Fixed bug #72551, bug #72552 (In correct casting from size_t to int lead to
heap overflow in mdecrypt_generic). (Stas)
- PDO_pgsql:
. Fixed bug #72570 (Segmentation fault when binding parameters on a query
without placeholders). (Matteo)
- PCRE:
. Fixed bug #72476 (Memleak in jit_stack). (Laruence)
. Fixed bug #72463 (mail fails with invalid argument). (Anatol)
- Readline:
. Fixed bug #72538 (readline_redisplay crashes php). (Laruence)
- Standard:
. Fixed bug #72505 (readfile() mangles files larger than 2G). (Cschneid)
. Fixed bug #72306 (Heap overflow through proc_open and $env parameter).
(Laruence)
- Session:
. Fixed bug #72531 (ps_files_cleanup_dir Buffer overflow). (Laruence)
. Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session
Deserialization). (Stas)
- SNMP:
. Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and
unserialize()). (Stas)
- Streams:
. Fixed bug #72439 (Stream socket with remote address leads to a segmentation
fault). (Laruence)
- XMLRPC:
. Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn
simplestring.c). (Stas)
- Zip:
. Fixed bug #72520 (Stack-based buffer overflow vulnerability in
php_stream_zip_opener). (Stas)
23 Jun 2016 PHP 7.0.8
- Core:
. Fixed bug #72218 (If host name cannot be resolved then PHP 7 crashes).
(Esminis at esminis dot lt)
. Fixed bug #72221 (segfault, past-the-end access). (Lauri Kenttä)
. Fixed bug #72268 (Integer Overflow in nl2br()). (Stas)
. Fixed bug #72275 (Integer Overflow in json_encode()/json_decode()/
json_utf8_to_utf16()). (Stas)
. Fixed bug #72400 (Integer Overflow in addcslashes/addslashes). (Stas)
. Fixed bug #72403 (Integer Overflow in Length of String-typed ZVAL). (Stas)
- Date:
. Fixed bug #63740 (strtotime seems to use both sunday and monday as start of
week). (Derick)
- FPM:
. Fixed bug #72308 (fastcgi_finish_request and logging environment
variables). (Laruence)
- GD:
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
(cmb)
. Fixed bug #72298 (pass2_no_dither out-of-bounds access). (Stas)
. Fixed bug #72337 (invalid dimensions can lead to crash). (Pierre)
. Fixed bug #72339 (Integer Overflow in _gd2GetHeader() resulting in heap
overflow). (CVE-2016-5766) (Pierre)
. Fixed bug #72407 (NULL Pointer Dereference at _gdScaleVert). (Stas)
. Fixed bug #72446 (Integer Overflow in gdImagePaletteToTrueColor() resulting
in heap overflow). (CVE-2016-5767) (Pierre)
- Intl:
. Fixed bug #70484 (selectordinal doesn't work with named parameters).
(Anatol)
- mbstring:
. Fixed bug #72402 (_php_mb_regex_ereg_replace_exec - double free).
(CVE-2016-5768) (Stas)
- mcrypt:
. Fixed bug #72455 (Heap Overflow due to integer overflows). (CVE-2016-5769)
(Stas)
- OpenSSL:
. Fixed bug #72140 (segfault after calling ERR_free_strings()).
(Jakub Zelenka)
- PCRE:
. Fixed bug #72143 (preg_replace uses int instead of size_t). (Joe)
- PDO_pgsql:
. Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound).
(Laruence)
. Fixed bug #72294 (Segmentation fault/invalid pointer in connection
with pgsql_stmt_dtor). (Anatol)
- Phar:
. Fixed bug #72321 (invalid free in phar_extract_file()).
(hji at dyntopia dot com)
- Phpdbg:
. Fixed bug #72284 (phpdbg fatal errors with coverage). (Bob)
- Postgres:
. Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free). (Laruence)
. Fixed bug #72197 (pg_lo_create arbitrary read). (Anatol)
- Standard:
. Fixed bug #72369 (array_merge() produces references in PHP7). (Dmitry)
. Fixed bug #72300 (ignore_user_abort(false) has no effect). (Laruence)
. Fixed bug #72229 (Wrong reference when serialize/unserialize an object).
(Laruence)
. Fixed bug #72193 (dns_get_record returns array containing elements of
type 'unknown'). (Laruence)
. Fixed bug #72017 (range() with float step produces unexpected result).
(Thomas Punt)
- WDDX:
. Fixed bug #72340 (Double Free Courruption in wddx_deserialize).
(CVE-2016-5772) (Stas)
- XML:
. Fixed bug #72206 (xml_parser_create/xml_parser_free leaks mem). (Joe)
- XMLRPC:
. Fixed bug #72155 (use-after-free caused by get_zval_xmlrpc_type).
(Joe, Laruence)
- Zip:
. Fixed ug #72258 (ZipArchive converts filenames to unrecoverable form).
(Anatol)
. Fixed bug #72434 (ZipArchive class Use After Free Vulnerability in PHP's GC
algorithm and unserialize). (CVE-2016-5773) (Dmitry)
26 May 2016 PHP 7.0.7
- Core:
. Fixed bug #72162 (use-after-free - error_reporting). (Laruence)
. Add compiler option to disable special case function calls. (Joe)
. Fixed bug #72101 (crash on complex code). (Dmitry)
. Fixed bug #72100 (implode() inserts garbage into resulting string when
joins very big integer). (Mikhail Galanin)
. Fixed bug #72057 (PHP Hangs when using custom error handler and typehint).
(Nikita Nefedov)
. Fixed bug #72038 (Function calls with values to a by-ref parameter don't
always throw a notice). (Bob)
. Fixed bug #71737 (Memory leak in closure with parameter named $this).
(Nikita)
. Fixed bug #72059 (?? is not allowed on constant expressions). (Bob, Marcio)
. Fixed bug #72159 (Imported Class Overrides Local Class Name). (Nikita)
- Curl:
. Fixed bug #68658 (Define CURLE_SSL_CACERT_BADFILE). (Pierrick)
- DBA:
. Fixed bug #72157 (use-after-free caused by dba_open). (Shm, Laruence)
- GD:
. Fixed bug #72227 (imagescale out-of-bounds read). (Stas)
- Intl:
. Fixed bug #64524 (Add intl.use_exceptions to php.ini-*). (Anatol)
. Fixed bug #72241 (get_icu_value_internal out-of-bounds read). (Stas)
- JSON:
. Fixed bug #72069 (Behavior \JsonSerializable different from json_encode).
(Laruence)
- Mbstring:
. Fixed bug #72164 (Null Pointer Dereference - mb_ereg_replace). (Laruence)
- OCI8:
. Fixed bug #71600 (oci_fetch_all segfaults when selecting more than eight
columns). (Tian Yang)
- Opcache:
. Fixed bug #72014 (Including a file with anonymous classes multiple times
leads to fatal error). (Laruence)
- OpenSSL:
. Fixed bug #72165 (Null pointer dereference - openssl_csr_new). (Anatol)
- PCNTL:
. Fixed bug #72154 (pcntl_wait/pcntl_waitpid array internal structure
overwrite). (Laruence)
- POSIX:
. Fixed bug #72133 (php_posix_group_to_array crashes if gr_passwd is NULL).
(esminis at esminis dot lt)
- Postgres:
. Fixed bug #72028 (pg_query_params(): NULL converts to empty string).
(Laruence)
. Fixed bug #71062 (pg_convert() doesn't accept ISO 8601 for datatype
timestamp). (denver at timothy dot io)
. Fixed bug #72151 (mysqli_fetch_object changed behaviour). (Anatol)
- Reflection:
. Fixed bug #72174 (ReflectionProperty#getValue() causes __isset call).
(Nikita)
- Session:
. Fixed bug #71972 (Cyclic references causing session_start(): Failed to
decode session object). (Laruence)
- Sockets:
. Added socket_export_stream() function for getting a stream compatible
resource from a socket resource. (Chris Wright, Bob)
- SPL:
. Fixed bug #72051 (The reference in CallbackFilterIterator doesn't work as
expected). (Laruence)
- SQLite3:
. Fixed bug #68849 (bindValue is not using the right data type). (Anatol)
- Standard:
. Fixed bug #72075 (Referencing socket resources breaks stream_select).
(Laruence)
. Fixed bug #72031 (array_column() against an array of objects discards all
values matching null). (Nikita)
28 Apr 2016 PHP 7.0.6
- Core:
. Fixed bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1'
failed). (Laruence)
. Fixed bug #71922 (Crash on assert(new class{})). (Nikita)
. Fixed bug #71914 (Reference is lost in "switch"). (Laruence)
. Fixed bug #71871 (Interfaces allow final and abstract functions). (Nikita)
. Fixed Bug #71859 (zend_objects_store_call_destructors operates on realloced
memory, crashing). (Laruence)
. Fixed bug #71841 (EG(error_zval) is not handled well). (Laruence)
. Fixed bug #71750 (Multiple Heap Overflows in php_raw_url_encode/
php_url_encode). (Stas)
. Fixed bug #71731 (Null coalescing operator and ArrayAccess). (Nikita)
. Fixed bug #71609 (Segmentation fault on ZTS with gethostbyname). (krakjoe)
. Fixed bug #71414 (Inheritance, traits and interfaces). (krakjoe)
. Fixed bug #71359 (Null coalescing operator and magic). (krakjoe)
. Fixed bug #71334 (Cannot access array keys while uksort()). (Nikita)
. Fixed bug #69659 (ArrayAccess, isset() and the offsetExists method).
(Nikita)
. Fixed bug #69537 (__debugInfo with empty string for key gives error).
(krakjoe)
. Fixed bug #62059 (ArrayObject and isset are not friends). (Nikita)
. Fixed bug #71980 (Decorated/Nested Generator is Uncloseable in Finally).
(Nikita)
- BCmath:
. Fixed bug #72093 (bcpowmod accepts negative scale and corrupts
_one_ definition). (Stas)
- Curl:
. Fixed bug #71831 (CURLOPT_NOPROXY applied as long instead of string).
(Michael Sierks)
- Date:
. Fixed bug #71889 (DateInterval::format Segmentation fault). (Thomas Punt)
- EXIF:
. Fixed bug #72094 (Out of bounds heap read access in exif header processing). (Stas)
- GD:
. Fixed bug #71912 (libgd: signedness vulnerability). (CVE-2016-3074) (Stas)
- Intl:
. Fixed bug #71516 (IntlDateFormatter looses locale if pattern is set via
constructor). (Anatol)
. Fixed bug #70455 (Missing constant: IntlChar::NO_NUMERIC_VALUE). (Anatol)
. Fixed bug #70451, #70452 (Inconsistencies in return values of IntlChar
methods). (Daniel Persson)
. Fixed bug #68893 (Stackoverflow in datefmt_create). (Anatol)
. Fixed bug #66289 (Locale::lookup incorrectly returns en or en_US if locale
is empty). (Anatol)
. Fixed bug #70484 (selectordinal doesn't work with named parameters).
(Anatol)
. Fixed bug #72061 (Out-of-bounds reads in zif_grapheme_stripos with negative
offset). (Stas)
- ODBC:
. Fixed bug #63171 (Script hangs after max_execution_time). (Remi)
- Opcache:
. Fixed bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER).
(Laruence)
- PDO:
. Fixed bug #52098 (Own PDOStatement implementation ignore __call()).
(Daniel kalaspuffar, Julien)
. Fixed bug #71447 (Quotes inside comments not properly handled). (Matteo)
- PDO_DBlib:
. Fixed bug #71943 (dblib_handle_quoter needs to allocate an extra byte).
(Adam Baratz)
. Add DBLIB-specific attributes for controlling timeouts. (Adam Baratz)
- PDO_pgsql:
. Fixed bug #62498 (pdo_pgsql inefficient when getColumnMeta() is used).
(Joseph Bylund)
- Postgres:
. Fixed bug #71820 (pg_fetch_object binds parameters before call
constructor). (Anatol)
. Fixed bug #71998 (Function pg_insert does not insert when column
type = inet). (Anatol)
- SOAP:
. Fixed bug #71986 (Nested foreach assign-by-reference creates broken
variables). (Laruence)
- SPL:
. Fixed bug #71838 (Deserializing serialized SPLObjectStorage-Object can't
access properties in PHP). (Nikita)
. Fixed bug #71735 (Double-free in SplDoublyLinkedList::offsetSet). (Stas)
. Fixed bug #67582 (Cloned SplObjectStorage with overwritten getHash fails
offsetExists()). (Nikita)
. Fixed bug #52339 (SPL autoloader breaks class_exists()). (Nikita)
- Standard:
. Fixed bug #71995 (Returning the same var twice from __sleep() produces
broken serialized data). (Laruence)
. Fixed bug #71940 (Unserialize crushes on restore object reference).
(Laruence)
. Fixed bug #71969 (str_replace returns an incorrect resulting array after
a foreach by reference). (Laruence)
. Fixed bug #71891 (header_register_callback() and
register_shutdown_function()). (Laruence)
. Fixed bug #71884 (Null pointer deref (segfault) in
stream_context_get_default). (Laruence)
. Fixed bug #71840 (Unserialize accepts wrongly data). (Ryat, Laruence)
. Fixed bug #71837 (Wrong arrays behaviour). (Laruence)
. Fixed bug #71827 (substr_replace bug, string length). (krakjoe)
. Fixed bug #67512 (php_crypt() crashes if crypt_r() does not exist or
_REENTRANT is not defined). (Nikita)
. Fixed bug #72116 (array_fill optimization breaks implementation). (Bob)
- XML:
. Fixed bug #72099 (xml_parse_into_struct segmentation fault). (Stas)
- Zip:
. Fixed bug #71923 (integer overflow in ZipArchive::getFrom*).
(CVE-2016-3078) (Stas)
31 Mar 2016 PHP 7.0.5
- Core:
. Huge pages disabled by default. (Rasmus)
@@ -33,15 +424,26 @@ PHP NEWS
. Fixed bug #71624 (`php -R` (PHP_MODE_PROCESS_STDIN) is broken).
(Sean DuBois)
- CLI Server:
. Fixed bug #69953 (Support MKCALENDAR request method). (Christoph)
- Curl:
. Fixed bug #71694 (Support constant CURLM_ADDED_ALREADY). (mpyw)
- Date:
. Fixed bug #71635 (DatePeriod::getEndDate segfault). (Thomas Punt)
- Fileinfo:
. Fixed bug #71527 (Buffer over-write in finfo_open with malformed magic
file). (CVE-2015-8865) (Anatol)
- libxml:
. Fixed bug #71536 (Access Violation crashes php-cgi.exe). (Anatol)
- mbstring:
. Fixed bug #71906 (AddressSanitizer: negative-size-param (-1) in
mbfl_strcut). (CVE-2016-4073) (Stas)
- ODBC:
. Fixed bug #47803, #69526 (Executing prepared statements is succesfull only
for the first two statements). (einavitamar at gmail dot com, Anatol)
@@ -51,21 +453,26 @@ PHP NEWS
(nish dot aravamudan at canonical dot com)
- PDO_DBlib:
. Bug #54648 (PDO::MSSQL forces format of datetime fields).
. Fixed bug #54648 (PDO::MSSQL forces format of datetime fields).
(steven dot lambeth at gmx dot de, Anatol)
- Phar:
. Fixed bug #71625 (Crash in php7.dll with bad phar filename).
(Anatol)
. Fixed bug #71625 (Crash in php7.dll with bad phar filename). (Anatol)
. Fixed bug #71317 (PharData fails to open specific file). (Jos Elstgeest)
. Fixed bug #71860 (Invalid memory write in phar on filename with \0 in
name). (CVE-2016-4072) (Stas)
- phpdbg:
. Fixed crash when advancing (except step) inside an internal function. (Bob)
- Session:
. Fixed Bug #71683 (Null pointer dereference in zend_hash_str_find_bucket).
. Fixed bug #71683 (Null pointer dereference in zend_hash_str_find_bucket).
(Yasuo)
- SNMP:
. Fixed bug #71704 (php_snmp_error() Format String Vulnerability).
(CVE-2016-4071) (andrew at jmpesp dot org)
- SPL:
. Fixed bug #71617 (private properties lost when unserializing ArrayObject).
(Nikita)
@@ -73,6 +480,8 @@ PHP NEWS
- Standard:
. Fixed bug #71660 (array_column behaves incorrectly after foreach by
reference). (Laruence)
. Fixed bug #71798 (Integer Overflow in php_raw_url_encode). (CVE-2016-4070)
(taoguangchen at icloud dot com, Stas)
- Zip:
. Update bundled libzip to 1.1.2. (Remi, Anatol)
@@ -96,7 +505,8 @@ PHP NEWS
using count). (Nikita)
. Fixed bug #71601 (finally block not executed after yield from). (Bob)
. Fixed bug #71637 (Multiple Heap Overflow due to integer overflows in
xml/filter_url/addcslashes). (Stas)
xml/filter_url/addcslashes). (CVE-2016-4344, CVE-2016-4345, CVE-2016-4346)
(Stas)
- CLI server:
. Fixed bug #71559 (Built-in HTTP server, we can download file in web by bug).
@@ -132,7 +542,7 @@ PHP NEWS
- SOAP:
. Fixed bug #71610 (Type Confusion Vulnerability - SOAP /
make_http_soap_request()). (Stas)
make_http_soap_request()). (CVE-2016-3185) (Stas)
- Standard:
. Fixed bug #71603 (compact() maintains references in php7). (Laruence)
@@ -194,13 +604,18 @@ PHP NEWS
. Fixed bug #71475 (openssl_seal() uninitialized memory usage). (Stas)
- PCRE:
. Upgraded pcrelib to 8.38.
. Upgraded pcrelib to 8.38. (CVE-2015-8383, CVE-2015-8386, CVE-2015-8387,
CVE-2015-8389, CVE-2015-8390, CVE-2015-8391, CVE-2015-8393, CVE-2015-8394)
- Phar:
. Fixed bug #71354 (Heap corruption in tar/zip/phar parser). (Stas)
. Fixed bug #71354 (Heap corruption in tar/zip/phar parser). (CVE-2016-4342)
(Stas)
. Fixed bug #71331 (Uninitialized pointer in phar_make_dirstream()).
(CVE-2016-4343) (Stas)
. Fixed bug #71391 (NULL Pointer Dereference in phar_tar_setupmetadata()).
(Stas)
. Fixed bug #71488 (Stack overflow when decompressing tar archives). (Stas)
. Fixed bug #71488 (Stack overflow when decompressing tar archives).
(CVE-2016-2554) (Stas)
- SOAP:
. Fixed bug #70979 (crash with bad soap request). (Anatol)
@@ -276,7 +691,7 @@ PHP NEWS
- GD:
. Fixed bug #70976 (Memory Read via gdImageRotateInterpolated Array Index
Out of Bounds). (emmanuel dot law at gmail dot com)
Out of Bounds). (CVE-2016-1903) (emmanuel dot law at gmail dot com)
- Mbstring:
. Fixed bug #71066 (mb_send_mail: Program terminated with signal SIGSEGV,
@@ -304,7 +719,7 @@ PHP NEWS
- Standard:
. Fixed bug #71270 (Heap BufferOver Flow in escapeshell functions).
(emmanuel dot law at gmail dot com)
(CVE-2016-1904) (emmanuel dot law at gmail dot com)
- WDDX:
. Fixed bug #70661 (Use After Free Vulnerability in WDDX Packet
@@ -722,7 +1137,8 @@ PHP NEWS
- GD:
. Fixed bug #53156 (imagerectangle problem with point ordering). (cmb)
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (cmb)
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
(cmb)
. Fixed bug #70102 (imagecreatefromwebm() shifts colors). (cmb)
. Fixed bug #66590 (imagewebp() doesn't pad to even length). (cmb)
. Fixed bug #66882 (imagerotate by -90 degrees truncates image by 1px). (cmb)
@@ -849,7 +1265,7 @@ PHP NEWS
. Implemented FR #70438 (Add IV parameter for openssl_seal and openssl_open)
(Jakub Zelenka)
. Fixed bug #70014 (openssl_random_pseudo_bytes() is not cryptographically
secure). (Stas)
secure). (CVE-2015-8867) (Stas)
. Fixed bug #69882 (OpenSSL error "key values mismatch" after
openssl_pkcs12_read with extra cert). (Tomasz Sawicki)
. Added "alpn_protocols" SSL context option allowing encrypted client/server
@@ -1097,7 +1513,8 @@ PHP NEWS
(Daniel Lowrey & Bob Weinand)
- Zip:
. Fixed bug #70322 (ZipArchive::close() doesn't indicate errors). (cmb)
. Fixed bug #70322 (ZipArchive::close() doesn't indicate errors).
(CVE-2014-9767) (cmb)
. Fixed bug #70350 (ZipArchive::extractTo allows for directory traversal when
creating directories). (neal at fb dot com)
. Added ZipArchive::setCompressionName and ZipArchive::setCompressionIndex
+197
View File
@@ -0,0 +1,197 @@
# =================================================================================
# http://www.gnu.org/software/autoconf-archive/ax_func_which_gethostbyname_r.html
# =================================================================================
#
# SYNOPSIS
#
# AX_FUNC_WHICH_GETHOSTBYNAME_R
#
# DESCRIPTION
#
# Determines which historical variant of the gethostbyname_r() call
# (taking three, five, or six arguments) is available on the system and
# defines one of the following macros accordingly:
#
# HAVE_FUNC_GETHOSTBYNAME_R_6
# HAVE_FUNC_GETHOSTBYNAME_R_5
# HAVE_FUNC_GETHOSTBYNAME_R_3
#
# as well as
#
# HAVE_GETHOSTBYNAME_R
#
# If used in conjunction with gethostname.c, the API demonstrated in
# test.c can be used regardless of which gethostbyname_r() is available.
# These example files can be found at
# http://www.csn.ul.ie/~caolan/publink/gethostbyname_r
#
# based on David Arnold's autoconf suggestion in the threads faq
#
# Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten for
# Autoconf 2.5x, and updated for 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Caolan McNamara <caolan@skynet.ie>
# Copyright (c) 2008 Daniel Richard G. <skunk@iskunk.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 7
AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
AC_LANG_PUSH([C])
AC_MSG_CHECKING([how many arguments gethostbyname_r() takes])
AC_CACHE_VAL([ac_cv_func_which_gethostbyname_r], [
################################################################
ac_cv_func_which_gethostbyname_r=unknown
#
# ONE ARGUMENT (sanity check)
#
# This should fail, as there is no variant of gethostbyname_r() that takes
# a single argument. If it actually compiles, then we can assume that
# netdb.h is not declaring the function, and the compiler is thereby
# assuming an implicit prototype. In which case, we're out of luck.
#
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[
char *name = "www.gnu.org";
(void)gethostbyname_r(name) /* ; */
])],
[ac_cv_func_which_gethostbyname_r=no])
#
# SIX ARGUMENTS
# (e.g. Linux)
#
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[
char *name = "www.gnu.org";
struct hostent ret, *retp;
char buf@<:@1024@:>@;
int buflen = 1024;
int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
])],
[ac_cv_func_which_gethostbyname_r=six])
fi
#
# FIVE ARGUMENTS
# (e.g. Solaris)
#
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[
char *name = "www.gnu.org";
struct hostent ret;
char buf@<:@1024@:>@;
int buflen = 1024;
int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
])],
[ac_cv_func_which_gethostbyname_r=five])
fi
#
# THREE ARGUMENTS
# (e.g. AIX, HP-UX, Tru64)
#
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],
[
char *name = "www.gnu.org";
struct hostent ret;
struct hostent_data data;
(void)gethostbyname_r(name, &ret, &data) /* ; */
])],
[ac_cv_func_which_gethostbyname_r=three])
fi
################################################################
]) dnl end AC_CACHE_VAL
case "$ac_cv_func_which_gethostbyname_r" in
three|five|six)
AC_DEFINE([HAVE_GETHOSTBYNAME_R], [1],
[Define to 1 if you have some form of gethostbyname_r().])
;;
esac
case "$ac_cv_func_which_gethostbyname_r" in
three)
AC_MSG_RESULT([three])
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_3], [1],
[Define to 1 if you have the three-argument form of gethostbyname_r().])
;;
five)
AC_MSG_RESULT([five])
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_5], [1],
[Define to 1 if you have the five-argument form of gethostbyname_r().])
;;
six)
AC_MSG_RESULT([six])
AC_DEFINE([HAVE_FUNC_GETHOSTBYNAME_R_6], [1],
[Define to 1 if you have the six-argument form of gethostbyname_r().])
;;
no)
AC_MSG_RESULT([cannot find function declaration in netdb.h])
;;
unknown)
AC_MSG_RESULT([can't tell])
;;
*)
AC_MSG_ERROR([internal error])
;;
esac
AC_LANG_POP
]) dnl end AC_DEFUN
+3 -1
View File
@@ -1,3 +1,4 @@
m4_include([TSRM/m4/gethostbyname.m4])
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
AC_DEFUN([TSRM_CHECK_GCC_ARG],[
@@ -32,6 +33,8 @@ AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_FUNCS(sigprocmask)
AX_FUNC_WHICH_GETHOSTBYNAME_R()
])
@@ -89,7 +92,6 @@ else
fi
])
AC_DEFUN([TSRM_THREADS_CHECKS],[
dnl For the thread implementations, we always use --with-*
+12
View File
@@ -641,6 +641,10 @@ Other
- debug_zval_dump
It prints now "int" instead of "long", and "float" instead of "double".
- getenv()
Since 7.0.9, getenv() has optional second parameter, making it only
consider local environment and not SAPI environment if true.
========================================
6. New Functions
========================================
@@ -756,6 +760,14 @@ out, that the corresponding SDK isn't available anymore.
- 'gd PS font'
- 'gd PS encoding'
- Zip
. Filename encoding flags, as of 7.0.8
- ZipArchive::FL_ENC_GUESS
- ZipArchive::FL_ENC_RAW
- ZipArchive::FL_ENC_STRICT
- ZipArchive::FL_ENC_UTF_8
- ZipArchive::FL_ENC_CP437
========================================
11. Changes to INI File Handling
========================================
@@ -0,0 +1,43 @@
--TEST--
Using indirect append on ArrayAccess object
--FILE--
<?php
class AA implements ArrayAccess {
private $data = [];
public function &offsetGet($name) {
if (null === $name) {
return $this->data[];
} else {
return $this->data[$name];
}
}
public function offsetSet($name, $value) {
$this->data[$name] = $value;
}
public function offsetUnset($name) {}
public function offsetExists($name) {}
}
$aa = new AA;
$aa[3] = 1;
$aa[][][0] = 2;
var_dump($aa);
?>
--EXPECT--
object(AA)#1 (1) {
["data":"AA":private]=>
array(2) {
[3]=>
int(1)
[4]=>
array(1) {
[0]=>
array(1) {
[0]=>
int(2)
}
}
}
}
@@ -0,0 +1,36 @@
--TEST--
Array must be separated if unpacking by reference
--FILE--
<?php
function inc(&... $args) {
foreach ($args as &$arg) {
$arg++;
}
}
$arr = [1, 2];
$arr[] = 3;
$arr2 = $arr;
inc(...$arr);
var_dump($arr);
var_dump($arr2);
?>
--EXPECT--
array(3) {
[0]=>
int(2)
[1]=>
int(3)
[2]=>
int(4)
}
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
@@ -0,0 +1,11 @@
--TEST--
Serialization of backtick literal is incorrect
--INI--
zend.assertions=1
--FILE--
<?php
assert_options(ASSERT_WARNING);
assert(false && `echo -n ""`);
--EXPECTF--
Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d
+2 -1
View File
@@ -8,7 +8,8 @@ class Thing {}
function boom()
{
$reader = xml_parser_create();
xml_set_object($reader, new Thing());
$thing = new Thing();
xml_set_object($reader, $thing);
die("ok\n");
xml_parser_free($reader);
}
+1 -2
View File
@@ -10,5 +10,4 @@ class foo {
$obj = new foo("Hello world");
?>
--EXPECTF--
Fatal error: Cannot re-assign $this in %sbug41117_1.php on line 3
Fatal error: Cannot use $this as parameter in %s on line %d
+1 -1
View File
@@ -23,4 +23,4 @@ class B extends A {
}
?>
--EXPECTF--
Warning: Declaration of B::foo($var) should be compatible with A::foo() in %sbug62358.php on line %d
Fatal error: Declaration of B::foo($var) must be compatible with I::foo() in %sbug62358.php on line 17
+1 -1
View File
@@ -18,4 +18,4 @@ $test = new Foo();
var_dump($test instanceof Baz);
?>
--EXPECTF--
Fatal error: Access level to Bar::bad() must be public (as in class Baz) in %sbug69467.php on line %d
Fatal error: Access level to Foo::bad() must be public (as in class Baz) in %sbug69467.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #69537 (__debugInfo with empty string for key gives error)
--FILE--
<?php
class Foo {
public function __debugInfo(){
return ['' => 1];
}
}
var_dump(new Foo);
?>
--EXPECTF--
object(Foo)#%d (%d) {
[""]=>
int(1)
}
-2
View File
@@ -27,8 +27,6 @@ $c10 = new C10;
var_dump($c10[] += 5);
--EXPECTF--
Inside C10::offsetGet
Notice: Undefined variable: offset in %sbug69955.php on line 10
NULL
Inside C10::offsetSet
+61
View File
@@ -0,0 +1,61 @@
--TEST--
Bug #71359: Null coalescing operator and magic
--FILE--
<?php
class AA {
private $data = [];
public function __isset($name) {
echo "__isset($name)\n";
return array_key_exists($name, $this->data);
}
public function &__get($name) {
echo "__get($name)\n";
if (!array_key_exists($name, $this->data)) {
throw new Exception('Unknown offset');
}
return $this->data[$name];
}
public function __set($name, $value) {
echo "__set($name)\n";
$this->data[$name] = $value;
}
public function __unset($name) {
echo "__unset($name)\n";
unset($this->data[$name]);
}
}
$aa = new AA;
var_dump(isset($aa->zero->one->two));
var_dump(isset($aa->zero->foo));
var_dump($aa->zero ?? 42);
var_dump($aa->zero->one->two ?? 42);
$aa->zero = new AA;
$aa->zero->one = new AA;
var_dump(isset($aa->zero->one->two));
var_dump($aa->zero->one->two ?? 42);
?>
--EXPECT--
__isset(zero)
bool(false)
__isset(zero)
bool(false)
__isset(zero)
int(42)
__isset(zero)
int(42)
__set(zero)
__get(zero)
__set(one)
__isset(zero)
__get(zero)
__isset(one)
__get(one)
__isset(two)
bool(false)
__isset(zero)
__get(zero)
__isset(one)
__get(one)
__isset(two)
int(42)
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #71414 (Interface method override inherited method and implemented in a trait causes fatal error)
--FILE--
<?php
interface InterfaceY {
public function z(): string;
}
trait TraitY {
public function z(): string {
}
}
class X {
public function z() {
}
}
class Y extends X implements InterfaceY {
use TraitY;
}
echo "ok";
--EXPECT--
ok
+15
View File
@@ -0,0 +1,15 @@
--TEST--
bug #71428.1: inheritance with null default values
--XFAIL--
This is a BC break
--FILE--
<?php
class A {
public function m(array $a = null) {}
}
class B extends A {
public function m(array $a = []) {}
}
--EXPECTF--
Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(array $a = NULL) in %sbug71428.1.php on line 7
+23
View File
@@ -0,0 +1,23 @@
--TEST--
bug #71428.2: inheritance of ye olde dynamic interfaces
--SKIPIF--
<?php if (!extension_loaded('pdo')) die("skip PDO is not available"); ?>
--FILE--
<?php
interface StatementInterface {
public function fetch($first = null, $second, $third);
}
class Statement extends PDOStatement implements StatementInterface {}
interface StatementInterface1 {
public function fetch($first = null, $second = null, $third = null);
}
class Statement1 extends PDOStatement implements StatementInterface1 {}
echo "ok";
?>
--EXPECT--
ok
+13
View File
@@ -0,0 +1,13 @@
--TEST--
bug #71428: Validation type inheritance with = NULL
--XFAIL--
This is a BC break
--FILE--
<?php
class A { }
class B { public function m(A $a = NULL, $n) { echo "B.m";} };
class C extends B { public function m(A $a , $n) { echo "C.m";} };
?>
--EXPECTF--
Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(A $a = NULL, $n) in %sbug71428.3.php on line 4
+64
View File
@@ -0,0 +1,64 @@
--TEST--
Bug #71731: Null coalescing operator and ArrayAccess
--FILE--
<?php
class AA implements ArrayAccess {
private $data = [];
public function offsetExists($name) {
echo "offsetExists($name)\n";
return array_key_exists($name, $this->data);
}
public function &offsetGet($name) {
echo "offsetGet($name)\n";
if (!array_key_exists($name, $this->data)) {
throw new Exception('Unknown offset');
}
return $this->data[$name];
}
public function offsetSet($name, $value) {
echo "offsetSet($name)\n";
$this->data[$name] = $value;
}
public function offsetUnset($name) {
echo "offsetUnset($name)\n";
unset($this->data[$name]);
}
}
$aa = new AA;
var_dump(isset($aa[0][1][2]));
var_dump(isset($aa[0]->foo));
var_dump($aa[0] ?? 42);
var_dump($aa[0][1][2] ?? 42);
$aa[0] = new AA;
$aa[0][1] = new AA;
var_dump(isset($aa[0][1][2]));
var_dump($aa[0][1][2] ?? 42);
?>
--EXPECT--
offsetExists(0)
bool(false)
offsetExists(0)
bool(false)
offsetExists(0)
int(42)
offsetExists(0)
int(42)
offsetSet(0)
offsetGet(0)
offsetSet(1)
offsetExists(0)
offsetGet(0)
offsetExists(1)
offsetGet(1)
offsetExists(2)
bool(false)
offsetExists(0)
offsetGet(0)
offsetExists(1)
offsetGet(1)
offsetExists(2)
int(42)
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #71737: Memory leak in closure with parameter named $this
--FILE--
<?php
class Test {
public function method() {
return function($this) {};
}
}
(new Test)->method()(new stdClass);
?>
--EXPECTF--
Fatal error: Cannot use $this as parameter in %s on line %d
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #71841 (EG(error_zval) is not handled well)
--INI--
error_reporting=0
--FILE--
<?php
$z = unserialize('O:1:"A":0:{}');
var_dump($z->e.=0);
var_dump(++$z->x);
var_dump($z->y++);
$y = array(PHP_INT_MAX => 0);
var_dump($y[] .= 0);
var_dump(++$y[]);
var_dump($y[]++);
?>
--EXPECT--
NULL
NULL
NULL
NULL
NULL
NULL
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #71859 (zend_objects_store_call_destructors operates on realloced memory, crashing)
--FILE--
<?php
class constructs_in_destructor {
public function __destruct() {
//We are now in zend_objects_store_call_destructors
//This causes a realloc in zend_objects_store_put
for ($i = 0; $i < 10000; ++$i) {
$GLOBALS["a$i"] = new stdClass;
}
//Returns to zend_objects_store_call_destructors, to access freed memory.
}
}
$a = new constructs_in_destructor;
//Create cycle so destructors are ran only in zend_objects_store_call_destructors
$a->a = $a;
// Create some objects so zend_objects_store_call_destructors has something
// to do after constructs_in_destructor is destroyed.
for ($i = 0; $i < 200; ++$i) {
$GLOBALS["b$i"] = new stdClass;
}
?>
okey
--EXPECT--
okey
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #71871: Interfaces allow final and abstract functions
--FILE--
<?php
interface test {
final function test();
}
?>
--EXPECTF--
Fatal error: Access type for interface method test::test() must be omitted in %s on line %d
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #71871: Interfaces allow final and abstract functions
--FILE--
<?php
interface test {
abstract function test();
}
?>
--EXPECTF--
Fatal error: Access type for interface method test::test() must be omitted in %s on line %d
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Bug #71914 (Reference is lost in "switch")
--FILE--
<?php
function bug(&$value) {
switch ($value) {
case "xxxx":
$value = true;
break;
}
}
function returnArray() {
$array = array();
$array["str"] = "xxxx";
return $array;
}
class Foo {
public $array = array("str" => "xxxx");
}
function test($arr, &$dummy) {
bug($arr["str"]);
var_dump($arr["str"]);
}
$foo = new Foo();
$arr = returnArray();
$array = array("str" => "xxxx");
test($array, $array["str"]);
test($arr, $arr["str"]);
test($foo->array, $foo->array["str"]);
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #71922: Crash on assert(new class{});
--INI--
zend.assertions=1
assert.exception=1
--FILE--
<?php
try {
assert(0 && new class {
} && new class(42) extends stdclass {
});
} catch (AssertionError $e) {
echo "Assertion failure: ", $e->getMessage(), "\n";
}
?>
--EXPECT--
Assertion failure: assert(0 && new class {
} && new class(42) extends stdclass {
})
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1' failed)
--SKIPIF--
<?php
if (!extension_loaded("curl")) {
die("skip Require a resource which is able to hold a callbck");
}
?>
--FILE--
<?php
class A {
public static function dummy() {
}
}
$a = array();
$a[] = "A";
$a[] = "dummy";
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_HEADERFUNCTION, $a);
set_error_handler($a);
set_error_handler(function()use($ch1){});
set_error_handler(function(){});
?>
okey
--EXPECT--
okey
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #71980: Decorated/Nested Generator is Uncloseable in Finally
--FILE--
<?php
class Dtor {
public function __destruct() {
echo "Dtor\n";
}
}
function gen1() {
try {
foreach ([42, new Dtor] as $value) {
yield $value;
}
} finally {
echo "Finally\n";
}
}
function gen2() {
try {
var_dump(new Dtor, yield);
} finally {
echo "Finally\n";
}
}
$gen = gen1();
$gen->rewind();
unset($gen);
$gen = gen2();
$gen->rewind();
unset($gen);
?>
--EXPECT--
Dtor
Finally
Dtor
Finally
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
--FILE--
<?php
test($foo = new stdClass);
var_dump($foo);
test($bar = 2);
var_dump($bar);
test($baz = &$bar);
var_dump($baz);
function test(&$param) {
$param = 1;
}
?>
--EXPECTF--
Notice: Only variables should be passed by reference in %s on line %d
object(stdClass)#1 (0) {
}
Notice: Only variables should be passed by reference in %s on line %d
int(2)
int(1)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #72057 (PHP hangs when user error handler throws exception after Notice from type coercion)
--FILE--
<?php
set_error_handler(
function() {
throw new Exception("My custom error");
}
);
(function (int $i) { bar(); })("7as");
--EXPECTF--
Fatal error: Uncaught Exception: My custom error in %s:%d
Stack trace:
#0 %s(%d): {closure}(8, 'A non well form...', '%s', %d, Array)
#1 %s(%d): {closure}('7as')
#2 {main}
thrown in %s on line %d
+85
View File
@@ -0,0 +1,85 @@
--TEST--
Bug #72101 (crash on complex code)
--FILE--
<?php
class PHPUnit_Framework_MockObject_Stub_ReturnCallback {
protected $callback;
public function __construct($callback) {
$this->callback = $callback;
}
public function invoke($invocation) {
return call_user_func_array($this->callback, $invocation->parameters);
}
}
class PHPUnit_Framework_MockObject_InvocationMocker {
protected $matchers = [];
public function addMatcher( $matcher) {
$this->matchers[] = $matcher;
}
public function invoke( $invocation) {
foreach ($this->matchers as $match) {
$match->invoked($invocation);
}
}
}
class PHPUnit_Framework_MockObject_Matcher {
public $stub = null;
public function invoked($invocation) {
return $this->stub->invoke($invocation);
}
}
class MethodCallbackByReference {
public function bar(&$a, &$b, $c) {
Legacy::bar($a, $b, $c);
}
public function callback(&$a, &$b, $c) {
$b = 1;
}
}
class PHPUnit_Framework_MockObject_Invocation_Static {
public $parameters;
public function __construct(array $parameters) {
$this->parameters = $parameters;
}
}
class Mock_MethodCallbackByReference_7b180d26 extends MethodCallbackByReference {
public $inv_mocker;
public function bar(&$a, &$b, $c) {
$arguments = array($a, $b, $c);
$result = $this->inv_mocker->invoke(
new PHPUnit_Framework_MockObject_Invocation_Static(
$arguments
)
);
return $result;
}
}
set_error_handler(function() {
// var_dump(func_get_args());
DoesNotExists::$nope = true;
}, E_ALL | E_STRICT);
$foo = new Mock_MethodCallbackByReference_7b180d26();
$InvMocker = new PHPUnit_Framework_MockObject_InvocationMocker();
$foo->inv_mocker = $InvMocker;
$OuterMatcher = new PHPUnit_Framework_MockObject_Matcher();
$InvMocker->addMatcher($OuterMatcher);
$OuterMatcher->methodNameMatcher = null;
$OuterMatcher->stub = new PHPUnit_Framework_MockObject_Stub_ReturnCallback([$foo, 'callback']);
$a = $b = $c = 0;
$foo->bar($a, $b, $c);
--EXPECTF--
Fatal error: Uncaught Error: Class 'DoesNotExists' not found in %sbug72101.php:61
Stack trace:
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0)
#5 {main}
thrown in %sbug72101.php on line 61
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #72119 (Interface declaration compatibility regression with default values)
--FILE--
<?php
interface Foo {
public function bar(array $baz = null);
}
class Hello implements Foo {
public function bar(array $baz = [])
{
}
}
echo "OK\n";
?>
--EXPECT--
OK
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #72162 (use-after-free - error_reporting)
--FILE--
<?php
error_reporting(E_ALL);
$var11 = new StdClass();
$var16 = error_reporting($var11);
?>
--EXPECTF--
Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #72508 (strange references after recursive function call and "switch" statement)
--FILE--
<?php
function a ($option) {
b($option['bla']);
c($option);
var_dump($option);
}
function b (&$string) {
$string = 'changed';
}
function c ($option) {
switch ($option['bla']) {
default:
$copy = $option;
$copy['bla'] = 'copy';
break;
}
}
a(array('bla' => 'fasel'));
?>
--EXPECT--
array(1) {
["bla"]=>
string(7) "changed"
}
+28
View File
@@ -0,0 +1,28 @@
--TEST--
call_user_func() should error on reference arguments
--FILE--
<?php
namespace Foo;
function bar(&$ref) {
$ref = 24;
}
$x = 42;
$ref =& $x;
\call_user_func('Foo\bar', $x);
var_dump($x);
$y = 42;
$ref =& $y;
call_user_func('Foo\bar', $y);
var_dump($y);
?>
--EXPECTF--
Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
int(42)
Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d
int(42)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
call_user_func() should not use FUNC_ARG fetches
--FILE--
<?php
function foo(&$ref) { $ref = 24; }
$a = [];
call_user_func('foo', $a[0][0]);
var_dump($a);
?>
--EXPECTF--
Notice: Undefined offset: 0 in %s on line %d
Warning: Parameter 1 to foo() expected to be a reference, value given in %s on line %d
array(0) {
}
@@ -0,0 +1,73 @@
--TEST--
call_user_func_array() passes value to prefer-ref arg if element wasn't a reference
--FILE--
<?php
namespace {
call_user_func_array('array_multisort', [[3, 2, 1]]);
$args = [[3, 2, 1]];
call_user_func_array('array_multisort', $args);
var_dump($args);
unset($args);
$array = [3, 2, 1];
call_user_func('array_multisort', $array);
var_dump($array);
unset($array);
}
namespace Foo {
call_user_func_array('array_multisort', [[3, 2, 1]]);
$args = [[3, 2, 1]];
call_user_func_array('array_multisort', $args);
var_dump($args);
unset($args);
$array = [3, 2, 1];
call_user_func('array_multisort', $array);
var_dump($array);
unset($array);
}
?>
--EXPECT--
array(1) {
[0]=>
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
}
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
array(1) {
[0]=>
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
}
array(3) {
[0]=>
int(3)
[1]=>
int(2)
[2]=>
int(1)
}
@@ -0,0 +1,16 @@
--TEST--
Closure::__invoke() is case insensitive
--FILE--
<?php
$inc = function(&$n) {
$n++;
};
$n = 1;
$inc->__INVOKE($n);
var_dump($n);
?>
--EXPECT--
int(2)
@@ -0,0 +1,47 @@
--TEST--
Constant expressions with null coalescing operator ??
--FILE--
<?php
const A = [1 => [[]]];
const T_1 = null ?? A[1]['undefined']['index'] ?? 1;
const T_2 = null ?? A['undefined']['index'] ?? 2;
const T_3 = null ?? A[1][0][2] ?? 3;
const T_4 = A[1][0][2] ?? 4;
const T_5 = null ?? __LINE__;
const T_6 = __LINE__ ?? "bar";
var_dump(T_1);
var_dump(T_2);
var_dump(T_3);
var_dump(T_4);
var_dump(T_5);
var_dump(T_6);
var_dump((function(){ static $var = null ?? A[1]['undefined']['index'] ?? 1; return $var; })());
var_dump((function(){ static $var = null ?? A['undefined']['index'] ?? 2; return $var; })());
var_dump((function(){ static $var = null ?? A[1][0][2] ?? 3; return $var; })());
var_dump((function(){ static $var = A[1][0][2] ?? 4; return $var; })());
var_dump((new class { public $var = null ?? A[1]['undefined']['index'] ?? 1; })->var);
var_dump((new class { public $var = null ?? A['undefined']['index'] ?? 2; })->var);
var_dump((new class { public $var = null ?? A[1][0][2] ?? 3; })->var);
var_dump((new class { public $var = A[1][0][2] ?? 4; })->var);
?>
--EXPECTF--
int(1)
int(2)
int(3)
int(4)
int(%d)
int(%d)
int(1)
int(2)
int(3)
int(4)
int(1)
int(2)
int(3)
int(4)
@@ -0,0 +1,11 @@
--TEST--
Constant expressions with empty dimension fetch on coalesce
--FILE--
<?php
const A = [][] ?? 1;
?>
--EXPECTF--
Fatal error: Cannot use [] for reading in %s.php on line %d
+4 -1
View File
@@ -35,10 +35,12 @@ const T_19 = [
false => false,
true => true,
];
eval("const T_20x = 'a';");
const T_20 = null ?: (T_20x . 'bc');
var_dump(
T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9, T_10,
T_11, T_12, T_13, T_14, T_15, T_16, T_17, T_18, T_19
T_11, T_12, T_13, T_14, T_15, T_16, T_17, T_18, T_19, T_20
);
?>
@@ -75,3 +77,4 @@ array(6) {
[1]=>
bool(true)
}
string(3) "abc"
@@ -0,0 +1,15 @@
--TEST--
Crash when using dynamic call syntax with fully qualified name in a namespace
--FILE--
<?php
namespace Foo;
try {
('\bar')();
} catch (\Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Call to undefined function bar()
+4 -2
View File
@@ -3,10 +3,12 @@ Testing each() with array and object
--FILE--
<?php
$foo = each(new stdClass);
$a = new stdClass;
$foo = each($a);
var_dump($foo);
var_dump(each(new stdClass));
$a = new stdClass;
var_dump(each($a));
$a = array(new stdClass);
var_dump(each($a));
@@ -0,0 +1,37 @@
--TEST--
Cannot "yield from" from force closed generator
--FILE--
<?php
function gen1() {
echo "gen1\n";
yield 1;
}
function gen2() {
try {
echo "try\n";
yield from gen1();
} finally {
echo "finally\n";
yield from gen1();
}
}
try {
$gen = gen2();
$gen->rewind();
unset($gen);
} catch (Error $e) {
echo $e, "\n";
}
?>
--EXPECTF--
try
gen1
finally
Error: Cannot use "yield from" in a force-closed generator in %s:%d
Stack trace:
#0 %s(%d): gen2()
#1 {main}
@@ -80,7 +80,6 @@ class Obj
function __FILE__(){ echo __METHOD__, PHP_EOL; }
function __DIR__(){ echo __METHOD__, PHP_EOL; }
function __NAMESPACE__(){ echo __METHOD__, PHP_EOL; }
function __halt_compiler(){ echo __METHOD__, PHP_EOL; }
}
$obj = new Obj;
@@ -160,7 +159,6 @@ $obj->__LINE__();
$obj->__FILE__();
$obj->__DIR__();
$obj->__NAMESPACE__();
$obj->__halt_compiler();
echo "\nDone\n";
@@ -240,6 +238,5 @@ Obj::__LINE__
Obj::__FILE__
Obj::__DIR__
Obj::__NAMESPACE__
Obj::__halt_compiler
Done
@@ -80,7 +80,6 @@ class Obj
static function __FILE__(){ echo __METHOD__, PHP_EOL; }
static function __DIR__(){ echo __METHOD__, PHP_EOL; }
static function __NAMESPACE__(){ echo __METHOD__, PHP_EOL; }
static function __halt_compiler(){ echo __METHOD__, PHP_EOL; }
}
Obj::empty();
@@ -158,7 +157,6 @@ Obj::__LINE__();
Obj::__FILE__();
Obj::__DIR__();
Obj::__NAMESPACE__();
Obj::__halt_compiler();
echo "\nDone\n";
@@ -238,6 +236,5 @@ Obj::__LINE__
Obj::__FILE__
Obj::__DIR__
Obj::__NAMESPACE__
Obj::__halt_compiler
Done
@@ -79,7 +79,6 @@ class Obj
const __FILE__ = '__FILE__';
const __DIR__ = '__DIR__';
const __NAMESPACE__ = '__NAMESPACE__';
const __HALT_COMPILER = '__halt_compiler';
}
echo Obj::EMPTY, PHP_EOL;
@@ -156,7 +155,6 @@ echo Obj::__LINE__, PHP_EOL;
echo Obj::__FILE__, PHP_EOL;
echo Obj::__DIR__, PHP_EOL;
echo Obj::__NAMESPACE__, PHP_EOL;
echo Obj::__HALT_COMPILER, PHP_EOL;
echo "\nDone\n";
@@ -235,6 +233,5 @@ __LINE__
__FILE__
__DIR__
__NAMESPACE__
__halt_compiler
Done
@@ -0,0 +1,18 @@
--TEST--
Leak when using an invalid parent:: reference in a constant definition
--FILE--
<?php
class A {
const B = parent::C;
}
try {
A::B;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot access parent:: when current class scope has no parent
+7
View File
@@ -2,6 +2,13 @@
int memory_get_peak_usage ([ bool $real_usage = false ] );
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
--SKIPIF--
<?php
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
if ($zend_mm_enabled === "0") {
die("skip Zend MM disabled");
}
?>
--INI--
memory_limit=-1
--FILE--
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Indirect modification of isref by-value return value not possible
--FILE--
<?php
class A {
public $b;
}
$arr = [];
$a = new A;
$a->b =& $arr;
(new ReflectionProperty('A', 'b'))->getValue($a)[] = 42;
var_dump($a);
?>
--EXPECT--
object(A)#1 (1) {
["b"]=>
&array(0) {
}
}
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Class declaration colliding with import (in namespace)
--FILE--
<?php
namespace Foo {
class Bar {}
}
namespace Bazzle {
use Foo\Bar;
class Bar {}
}
--EXPECTF--
Fatal error: Cannot declare class Bazzle\Bar because the name is already in use in %s on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Function declaration colliding with import (in namespace)
--FILE--
<?php
namespace Foo {
function bar() {}
}
namespace Bazzle {
use function Foo\bar;
function bar() {}
}
--EXPECTF--
Fatal error: Cannot declare function Bazzle\bar because the name is already in use in %s on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Class declaration colliding with import (in namespace)
--FILE--
<?php
namespace Foo {
const BAR = 42;
}
namespace Bazzle {
use const Foo\BAR;
const BAR = 24;
}
--EXPECTF--
Fatal error: Cannot declare const Bazzle\BAR because the name is already in use in %s on line %d
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Leak in QM_ASSIGN when unwrapping references (rc=1)
--FILE--
<?php
function &ref() {
$str = "str";
$str .= "str";
return $str;
}
var_dump(true ? ref() : ref());
var_dump(ref() ?: ref());
var_dump(ref() ?? ref());
?>
--EXPECT--
string(6) "strstr"
string(6) "strstr"
string(6) "strstr"
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #71978 (Existence of return type hint affects other compatibility rules)
--FILE--
<?php
class A {
function foo(int $a) {}
}
class B extends A {
function foo(string $a) {}
}
class A1 {
function foo(int $a): int {}
}
class B1 extends A1 {
function foo(string $a): int {}
}
?>
--EXPECTF--
Warning: Declaration of B::foo(string $a) should be compatible with A::foo(int $a) in %s on line %d
Warning: Declaration of B1::foo(string $a): int should be compatible with A1::foo(int $a): int in %s on line %d
+1 -1
View File
@@ -16,4 +16,4 @@ class C implements IFoo {
}
--EXPECTF--
Fatal error: Declaration of TFoo::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d
Fatal error: Declaration of C::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d
+1
View File
@@ -3358,6 +3358,7 @@ again:
memcpy(ZSTR_VAL(*callable_name), ZSTR_VAL(ce->name), ZSTR_LEN(ce->name));
memcpy(ZSTR_VAL(*callable_name) + ZSTR_LEN(ce->name), "::__invoke", sizeof("::__invoke"));
}
fcc->initialized = 1;
return 1;
}
if (callable_name) {
+1 -2
View File
@@ -476,8 +476,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
/** Build zend_call_info/cache from a zval*
*
* Caller is responsible to provide a return value, otherwise the we will crash.
* fci->retval_ptr_ptr = NULL;
* Caller is responsible to provide a return value (fci->retval), otherwise the we will crash.
* In order to pass parameters the following members need to be set:
* fci->param_count = 0;
* fci->params = NULL;
+62 -18
View File
@@ -337,6 +337,22 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
zval_dtor(&op1);
}
break;
case ZEND_AST_COALESCE:
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
ret = FAILURE;
break;
}
if (Z_TYPE(op1) > IS_NULL) {
*result = op1;
} else {
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
zval_dtor(&op1);
ret = FAILURE;
break;
}
zval_dtor(&op1);
}
break;
case ZEND_AST_UNARY_PLUS:
if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[0], scope) != SUCCESS)) {
ret = FAILURE;
@@ -385,6 +401,10 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
}
break;
case ZEND_AST_DIM:
if (ast->child[1] == NULL) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
ret = FAILURE;
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
@@ -393,7 +413,12 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
} else {
zval tmp;
zend_fetch_dimension_by_zval(&tmp, &op1, &op2);
if (ast->attr == ZEND_DIM_IS) {
zend_fetch_dimension_by_zval_is(&tmp, &op1, &op2, IS_CONST);
} else {
zend_fetch_dimension_by_zval(&tmp, &op1, &op2);
}
if (UNEXPECTED(Z_ISREF(tmp))) {
ZVAL_DUP(result, Z_REFVAL(tmp));
} else {
@@ -922,6 +947,21 @@ static void zend_ast_export_zval(smart_str *str, zval *zv, int priority, int ind
}
}
static void zend_ast_export_class_no_header(smart_str *str, zend_ast_decl *decl, int indent) {
if (decl->child[0]) {
smart_str_appends(str, " extends ");
zend_ast_export_ns_name(str, decl->child[0], 0, indent);
}
if (decl->child[1]) {
smart_str_appends(str, " implements ");
zend_ast_export_ex(str, decl->child[1], 0, indent);
}
smart_str_appends(str, " {\n");
zend_ast_export_stmt(str, decl->child[2], indent + 1);
zend_ast_export_indent(str, indent);
smart_str_appends(str, "}");
}
#define BINARY_OP(_op, _p, _pl, _pr) do { \
op = _op; \
p = _p; \
@@ -1048,18 +1088,8 @@ tail_call:
smart_str_appends(str, "class ");
}
smart_str_appendl(str, ZSTR_VAL(decl->name), ZSTR_LEN(decl->name));
if (decl->child[0]) {
smart_str_appends(str, " extends ");
zend_ast_export_ns_name(str, decl->child[0], 0, indent);
}
if (decl->child[1]) {
smart_str_appends(str, " implements ");
zend_ast_export_ex(str, decl->child[1], 0, indent);
}
smart_str_appends(str, " {\n");
zend_ast_export_stmt(str, decl->child[2], indent + 1);
zend_ast_export_indent(str, indent);
smart_str_appends(str, "}\n");
zend_ast_export_class_no_header(str, decl, indent);
smart_str_appendc(str, '\n');
break;
/* list nodes */
@@ -1187,7 +1217,11 @@ simple_list:
if (ast->child[0]->kind == ZEND_AST_ENCAPS_LIST) {
zend_ast_export_encaps_list(str, '`', (zend_ast_list*)ast->child[0], indent);
} else {
zend_ast_export_ex(str, ast->child[0], 0, indent);
zval *zv;
ZEND_ASSERT(ast->child[0]->kind == ZEND_AST_ZVAL);
zv = zend_ast_get_zval(ast->child[0]);
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
zend_ast_export_qstr(str, '`', Z_STR_P(zv));
}
smart_str_appendc(str, '`');
break;
@@ -1344,10 +1378,20 @@ simple_list:
break;
case ZEND_AST_NEW:
smart_str_appends(str, "new ");
zend_ast_export_ns_name(str, ast->child[0], 0, indent);
smart_str_appendc(str, '(');
zend_ast_export_ex(str, ast->child[1], 0, indent);
smart_str_appendc(str, ')');
if (ast->child[0]->kind == ZEND_AST_CLASS) {
smart_str_appends(str, "class");
if (zend_ast_get_list(ast->child[1])->children) {
smart_str_appendc(str, '(');
zend_ast_export_ex(str, ast->child[1], 0, indent);
smart_str_appendc(str, ')');
}
zend_ast_export_class_no_header(str, (zend_ast_decl *) ast->child[0], indent);
} else {
zend_ast_export_ns_name(str, ast->child[0], 0, indent);
smart_str_appendc(str, '(');
zend_ast_export_ex(str, ast->child[1], 0, indent);
smart_str_appendc(str, ')');
}
break;
case ZEND_AST_INSTANCEOF:
zend_ast_export_ex(str, ast->child[0], 0, indent);
+17 -6
View File
@@ -704,7 +704,8 @@ ZEND_FUNCTION(error_reporting)
#endif
old_error_reporting = EG(error_reporting);
if(ZEND_NUM_ARGS() != 0) {
if (ZEND_NUM_ARGS() != 0) {
zend_string *new_val = zval_get_string(err);
do {
zend_ini_entry *p = EG(error_reporting_ini_entry);
@@ -730,7 +731,7 @@ ZEND_FUNCTION(error_reporting)
zend_string_release(p->value);
}
p->value = zval_get_string(err);
p->value = new_val;
if (Z_TYPE_P(err) == IS_LONG) {
EG(error_reporting) = Z_LVAL_P(err);
} else {
@@ -1183,7 +1184,7 @@ ZEND_FUNCTION(get_object_vars)
zobj = Z_OBJ_P(obj);
if (!zobj->ce->default_properties_count && properties == zobj->properties) {
if (!zobj->ce->default_properties_count && properties == zobj->properties && !ZEND_HASH_GET_APPLY_COUNT(properties)) {
/* fast copy */
if (EXPECTED(zobj->handlers == &std_object_handlers)) {
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
@@ -2387,8 +2388,10 @@ ZEND_FUNCTION(debug_print_backtrace)
if (object) {
if (func->common.scope) {
class_name = func->common.scope->name;
} else {
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
class_name = object->ce->name;
} else {
class_name = object->handlers->get_class_name(object);
}
call_type = "->";
@@ -2448,6 +2451,11 @@ ZEND_FUNCTION(debug_print_backtrace)
if (class_name) {
ZEND_PUTS(ZSTR_VAL(class_name));
ZEND_PUTS(call_type);
if (object
&& !func->common.scope
&& object->handlers->get_class_name != std_object_handlers.get_class_name) {
zend_string_release(class_name);
}
}
zend_printf("%s(", function_name);
if (Z_TYPE(arg_array) != IS_UNDEF) {
@@ -2607,9 +2615,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
if (object) {
if (func->common.scope) {
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(func->common.scope->name));
} else {
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(object->ce->name));
} else {
zend_string *class_name = object->handlers->get_class_name(object);
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, class_name);
zend_string_release(class_name);
}
if ((options & DEBUG_BACKTRACE_PROVIDE_OBJECT) != 0) {
zval zv;
+2 -6
View File
@@ -297,14 +297,10 @@ ZEND_API zval* zend_get_closure_this_ptr(zval *obj) /* {{{ */
static zend_function *zend_closure_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
zend_string *lc_name;
lc_name = zend_string_tolower(method);
if (zend_string_equals_literal(method, ZEND_INVOKE_FUNC_NAME)) {
zend_string_release(lc_name);
if (zend_string_equals_literal_ci(method, ZEND_INVOKE_FUNC_NAME)) {
return zend_get_closure_invoke_method(*object);
}
zend_string_release(lc_name);
return std_object_handlers.get_method(object, method, key);
}
/* }}} */
+124 -71
View File
@@ -611,16 +611,29 @@ static inline void zend_end_loop(int cont_addr) /* {{{ */
void zend_do_free(znode *op1) /* {{{ */
{
if (op1->op_type==IS_TMP_VAR) {
zend_op *opline = get_next_op(CG(active_op_array));
if (op1->op_type == IS_TMP_VAR) {
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
while (opline->opcode == ZEND_END_SILENCE) {
opline--;
}
if (opline->result_type == IS_TMP_VAR && opline->result.var == op1->u.op.var) {
if (opline->opcode == ZEND_BOOL || opline->opcode == ZEND_BOOL_NOT) {
return;
}
}
opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_FREE;
SET_NODE(opline->op1, op1);
SET_UNUSED(opline->op2);
} else if (op1->op_type==IS_VAR) {
} else if (op1->op_type == IS_VAR) {
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
while (opline->opcode == ZEND_END_SILENCE || opline->opcode == ZEND_EXT_FCALL_END || opline->opcode == ZEND_OP_DATA) {
while (opline->opcode == ZEND_END_SILENCE ||
opline->opcode == ZEND_EXT_FCALL_END ||
opline->opcode == ZEND_OP_DATA) {
opline--;
}
if (opline->result_type == IS_VAR
@@ -650,7 +663,7 @@ void zend_do_free(znode *op1) /* {{{ */
SET_UNUSED(opline->op2);
return;
}
if (opline->result_type==IS_VAR
if (opline->result_type == IS_VAR
&& opline->result.var == op1->u.op.var) {
if (opline->opcode == ZEND_NEW) {
opline->result_type |= EXT_TYPE_UNUSED;
@@ -760,6 +773,7 @@ zend_string *zend_resolve_non_class_name(
if (ZSTR_VAL(name)[0] == '\\') {
/* Remove \ prefix (only relevant if this is a string rather than a label) */
*is_fully_qualified = 1;
return zend_string_init(ZSTR_VAL(name) + 1, ZSTR_LEN(name) - 1, 0);
}
@@ -1203,7 +1217,7 @@ ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char
*class_name = NULL;
if (ZSTR_VAL(name)[0] != '\0') {
if (!ZSTR_LEN(name) || ZSTR_VAL(name)[0] != '\0') {
*prop_name = ZSTR_VAL(name);
if (prop_len) {
*prop_len = ZSTR_LEN(name);
@@ -3056,19 +3070,9 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
zend_ast *arg_ast = args->child[i];
znode arg_node;
zend_op *opline;
zend_bool send_user = 0;
if (zend_is_variable(arg_ast) && !zend_is_call(arg_ast)) {
zend_compile_var(&arg_node, arg_ast, BP_VAR_FUNC_ARG | (i << BP_VAR_SHIFT));
send_user = 1;
} else {
zend_compile_expr(&arg_node, arg_ast);
if (arg_node.op_type & (IS_VAR|IS_CV)) {
send_user = 1;
}
}
if (send_user) {
zend_compile_expr(&arg_node, arg_ast);
if (arg_node.op_type & (IS_VAR|IS_CV)) {
opline = zend_emit_op(NULL, ZEND_SEND_USER, &arg_node, NULL);
} else {
opline = zend_emit_op(NULL, ZEND_SEND_VAL, &arg_node, NULL);
@@ -3155,6 +3159,14 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return FAILURE;
}
if (zend_string_equals_literal(lcname, "assert")) {
return zend_compile_assert(result, args, lcname, fbc);
}
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
return FAILURE;
}
if (zend_string_equals_literal(lcname, "strlen")) {
return zend_compile_func_strlen(result, args);
} else if (zend_string_equals_literal(lcname, "is_null")) {
@@ -3185,8 +3197,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return zend_compile_func_cufa(result, args, lcname);
} else if (zend_string_equals_literal(lcname, "call_user_func")) {
return zend_compile_func_cuf(result, args, lcname);
} else if (zend_string_equals_literal(lcname, "assert")) {
return zend_compile_assert(result, args, lcname, fbc);
} else {
return FAILURE;
}
@@ -4015,16 +4025,32 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
znode expr_node, case_node;
zend_op *opline;
uint32_t *jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
uint32_t opnum_default_jmp;
uint32_t *jmpnz_opnums, opnum_default_jmp;
zend_compile_expr(&expr_node, expr_ast);
if (cases->children == 1 && cases->child[0]->child[0] == NULL) {
/* we have to take care about the case that only have one default branch,
* expr result will not be unrefed in this case, but it should be like in ZEND_CASE */
zend_ast *stmt_ast = cases->child[0]->child[1];
if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) {
zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL);
} else if (expr_node.op_type == IS_CONST) {
zval_dtor(&expr_node.u.constant);
}
zend_begin_loop(ZEND_NOP, NULL);
zend_compile_stmt(stmt_ast);
zend_end_loop(get_next_op_number(CG(active_op_array)));
return;
}
zend_begin_loop(ZEND_FREE, &expr_node);
case_node.op_type = IS_TMP_VAR;
case_node.u.op.var = get_temporary_variable(CG(active_op_array));
jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
for (i = 0; i < cases->children; ++i) {
zend_ast *case_ast = cases->child[i];
zend_ast *cond_ast = case_ast->child[0];
@@ -4471,8 +4497,9 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
zend_error_noreturn(E_COMPILE_ERROR, "Redefinition of parameter $%s",
ZSTR_VAL(name));
} else if (zend_string_equals_literal(name, "this")) {
if (op_array->scope && (op_array->fn_flags & ZEND_ACC_STATIC) == 0) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this");
if ((op_array->scope || (op_array->fn_flags & ZEND_ACC_CLOSURE))
&& (op_array->fn_flags & ZEND_ACC_STATIC) == 0) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as parameter");
}
op_array->this_var = var_node.u.op.var;
}
@@ -4636,7 +4663,7 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
zend_string *lcname;
if (in_interface) {
if ((op_array->fn_flags & ZEND_ACC_PPP_MASK) != ZEND_ACC_PUBLIC) {
if (!is_public || (op_array->fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_ABSTRACT))) {
zend_error_noreturn(E_COMPILE_ERROR, "Access type for interface method "
"%s::%s() must be omitted", ZSTR_VAL(ce->name), ZSTR_VAL(name));
}
@@ -4798,15 +4825,16 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl) /* {{{ */
{
zend_ast *params_ast = decl->child[0];
zend_string *name = decl->name, *lcname;
zend_string *unqualified_name, *name, *lcname;
zend_op *opline;
op_array->function_name = name = zend_prefix_with_ns(name);
unqualified_name = decl->name;
op_array->function_name = name = zend_prefix_with_ns(unqualified_name);
lcname = zend_string_tolower(name);
if (FC(imports_function)) {
zend_string *import_name = zend_hash_find_ptr(FC(imports_function), lcname);
zend_string *import_name = zend_hash_find_ptr_lc(
FC(imports_function), ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name));
if (import_name && !zend_string_equals_ci(lcname, import_name)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare function %s "
"because the name is already in use", ZSTR_VAL(name));
@@ -5189,7 +5217,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
zend_ast *extends_ast = decl->child[0];
zend_ast *implements_ast = decl->child[1];
zend_ast *stmt_ast = decl->child[2];
zend_string *name, *lcname, *import_name = NULL;
zend_string *name, *lcname;
zend_class_entry *ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry));
zend_op *opline;
znode declare_node, extends_node;
@@ -5198,31 +5226,25 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
znode original_implementing_class = FC(implementing_class);
if (EXPECTED((decl->flags & ZEND_ACC_ANON_CLASS) == 0)) {
zend_string *unqualified_name = decl->name;
if (CG(active_class_entry)) {
zend_error_noreturn(E_COMPILE_ERROR, "Class declarations may not be nested");
}
name = decl->name;
zend_assert_valid_class_name(name);
lcname = zend_string_tolower(name);
if (FC(current_namespace)) {
name = zend_prefix_with_ns(name);
zend_string_release(lcname);
lcname = zend_string_tolower(name);
} else {
zend_string_addref(name);
}
zend_assert_valid_class_name(unqualified_name);
name = zend_prefix_with_ns(unqualified_name);
name = zend_new_interned_string(name);
lcname = zend_string_tolower(name);
if (FC(imports)) {
import_name = zend_hash_find_ptr(FC(imports), lcname);
zend_string *import_name = zend_hash_find_ptr_lc(
FC(imports), ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name));
if (import_name && !zend_string_equals_ci(lcname, import_name)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s "
"because the name is already in use", ZSTR_VAL(name));
}
}
if (import_name && !zend_string_equals_ci(lcname, import_name)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s "
"because the name is already in use", ZSTR_VAL(name));
}
name = zend_new_interned_string(name);
} else {
name = zend_generate_anon_class_name(decl->lex_pos);
lcname = zend_string_tolower(name);
@@ -5298,10 +5320,6 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
CG(active_class_entry) = ce;
if (implements_ast) {
zend_compile_implements(&declare_node, implements_ast);
}
zend_compile_stmt(stmt_ast);
/* Reset lineno for final opcodes and errors */
@@ -5358,11 +5376,15 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
zend_emit_op(NULL, ZEND_BIND_TRAITS, &declare_node, NULL);
}
if (implements_ast) {
zend_compile_implements(&declare_node, implements_ast);
}
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
&& (extends_ast || ce->num_interfaces > 0)
&& (extends_ast || implements_ast)
) {
zend_verify_abstract_class(ce);
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
if (implements_ast) {
zend_emit_op(NULL, ZEND_VERIFY_ABSTRACT_CLASS, &declare_node, NULL);
}
}
@@ -5573,26 +5595,26 @@ void zend_compile_const_decl(zend_ast *ast) /* {{{ */
zend_ast *const_ast = list->child[i];
zend_ast *name_ast = const_ast->child[0];
zend_ast *value_ast = const_ast->child[1];
zend_string *name = zend_ast_get_str(name_ast);
zend_string *unqualified_name = zend_ast_get_str(name_ast);
zend_string *import_name;
zend_string *name;
znode name_node, value_node;
zval *value_zv = &value_node.u.constant;
value_node.op_type = IS_CONST;
zend_const_expr_to_zval(value_zv, value_ast);
if (zend_lookup_reserved_const(ZSTR_VAL(name), ZSTR_LEN(name))) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", ZSTR_VAL(name));
if (zend_lookup_reserved_const(ZSTR_VAL(unqualified_name), ZSTR_LEN(unqualified_name))) {
zend_error_noreturn(E_COMPILE_ERROR,
"Cannot redeclare constant '%s'", ZSTR_VAL(unqualified_name));
}
name = zend_prefix_with_ns(name);
name = zend_prefix_with_ns(unqualified_name);
name = zend_new_interned_string(name);
if (FC(imports_const)
&& (import_name = zend_hash_find_ptr(FC(imports_const), name))
) {
if (!zend_string_equals(import_name, name)) {
if (FC(imports_const)) {
zend_string *import_name = zend_hash_find_ptr(FC(imports_const), unqualified_name);
if (import_name && !zend_string_equals(import_name, name)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare const %s because "
"the name is already in use", ZSTR_VAL(name));
}
@@ -6054,7 +6076,7 @@ void zend_compile_short_circuiting(znode *result, zend_ast *ast) /* {{{ */
zval_ptr_dtor(&right_node.u.constant);
} else {
zend_emit_op(result, ZEND_BOOL, &right_node, NULL);
zend_emit_op_tmp(result, ZEND_BOOL, &right_node, NULL);
}
}
@@ -6819,7 +6841,7 @@ zend_bool zend_is_allowed_in_const_expr(zend_ast_kind kind) /* {{{ */
|| kind == ZEND_AST_CONDITIONAL || kind == ZEND_AST_DIM
|| kind == ZEND_AST_ARRAY || kind == ZEND_AST_ARRAY_ELEM
|| kind == ZEND_AST_CONST || kind == ZEND_AST_CLASS_CONST
|| kind == ZEND_AST_MAGIC_CONST;
|| kind == ZEND_AST_MAGIC_CONST || kind == ZEND_AST_COALESCE;
}
/* }}} */
@@ -6953,14 +6975,16 @@ void zend_const_expr_to_zval(zval *result, zend_ast *ast) /* {{{ */
zend_compile_const_expr(&ast);
if (ast->kind == ZEND_AST_ZVAL) {
ZVAL_COPY_VALUE(result, zend_ast_get_zval(ast));
/* Kill this branch of the original AST, as it was already destroyed.
* It would be nice to find a better solution to this problem in the
* future. */
orig_ast->kind = 0;
} else {
ZVAL_NEW_AST(result, zend_ast_copy(ast));
/* destroy the ast here, it might have been replaced */
zend_ast_destroy(ast);
}
/* Kill this branch of the original AST, as it was already destroyed.
* It would be nice to find a better solution to this problem in the
* future. */
orig_ast->kind = 0;
}
/* }}} */
@@ -7371,6 +7395,30 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
zend_ct_eval_unary_pm(&result, ast->kind, zend_ast_get_zval(ast->child[0]));
break;
case ZEND_AST_COALESCE:
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
if (ast->child[0]->kind == ZEND_AST_DIM) {
ast->child[0]->attr = ZEND_DIM_IS;
}
zend_eval_const_expr(&ast->child[0]);
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
/* ensure everything was compile-time evaluated at least once */
zend_eval_const_expr(&ast->child[1]);
return;
}
if (Z_TYPE_P(zend_ast_get_zval(ast->child[0])) == IS_NULL) {
zend_eval_const_expr(&ast->child[1]);
*ast_ptr = ast->child[1];
ast->child[1] = NULL;
zend_ast_destroy(ast);
} else {
*ast_ptr = ast->child[0];
ast->child[0] = NULL;
zend_ast_destroy(ast);
}
return;
case ZEND_AST_CONDITIONAL:
{
zend_ast **child, *child_ast;
@@ -7404,6 +7452,11 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
if (ast->attr == ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) {
ast->child[0]->attr = ZEND_DIM_IS;
}
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
+5
View File
@@ -889,6 +889,8 @@ ZEND_API void zend_assert_valid_class_name(const zend_string *const_name);
#define ZEND_SEND_BY_REF 1
#define ZEND_SEND_PREFER_REF 2
#define ZEND_DIM_IS 1
static zend_always_inline int zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask)
{
arg_num--;
@@ -1009,6 +1011,9 @@ END_EXTERN_C()
/* force IS_OBJ_USE_GUARDS for all classes */
#define ZEND_COMPILE_GUARDS (1<<9)
/* disable builtin special case function calls */
#define ZEND_COMPILE_NO_BUILTINS (1<<10)
/* The default value for CG(compiler_options) */
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY
+10 -20
View File
@@ -299,7 +299,6 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
zend_constant *c;
const char *colon;
zend_class_entry *ce = NULL;
zend_string *class_name;
const char *name = ZSTR_VAL(cname);
size_t name_len = ZSTR_LEN(cname);
@@ -315,13 +314,9 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
int class_name_len = colon - name - 1;
size_t const_name_len = name_len - class_name_len - 2;
zend_string *constant_name = zend_string_init(colon + 1, const_name_len, 0);
char *lcname;
zend_string *class_name = zend_string_init(name, class_name_len, 0);
zval *ret_constant = NULL;
ALLOCA_FLAG(use_heap)
class_name = zend_string_init(name, class_name_len, 0);
lcname = do_alloca(class_name_len + 1, use_heap);
zend_str_tolower_copy(lcname, name, class_name_len);
if (!scope) {
if (EG(current_execute_data)) {
scope = EG(scope);
@@ -330,48 +325,43 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
}
}
if (class_name_len == sizeof("self")-1 &&
!memcmp(lcname, "self", sizeof("self")-1)) {
if (zend_string_equals_literal_ci(class_name, "self")) {
if (UNEXPECTED(!scope)) {
zend_throw_error(NULL, "Cannot access self:: when no class scope is active");
return NULL;
goto failure;
}
ce = scope;
} else if (class_name_len == sizeof("parent")-1 &&
!memcmp(lcname, "parent", sizeof("parent")-1)) {
} else if (zend_string_equals_literal_ci(class_name, "parent")) {
if (UNEXPECTED(!scope)) {
zend_throw_error(NULL, "Cannot access parent:: when no class scope is active");
return NULL;
goto failure;
} else if (UNEXPECTED(!scope->parent)) {
zend_throw_error(NULL, "Cannot access parent:: when current class scope has no parent");
return NULL;
goto failure;
} else {
ce = scope->parent;
}
} else if (class_name_len == sizeof("static")-1 &&
!memcmp(lcname, "static", sizeof("static")-1)) {
} else if (zend_string_equals_literal_ci(class_name, "static")) {
ce = zend_get_called_scope(EG(current_execute_data));
if (UNEXPECTED(!ce)) {
zend_throw_error(NULL, "Cannot access static:: when no class scope is active");
return NULL;
goto failure;
}
} else {
ce = zend_fetch_class(class_name, flags);
}
free_alloca(lcname, use_heap);
if (ce) {
ret_constant = zend_hash_find(&ce->constants_table, constant_name);
if (ret_constant == NULL) {
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
zend_throw_error(NULL, "Undefined class constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
zend_string_release(class_name);
zend_string_free(constant_name);
return NULL;
}
} else if (Z_ISREF_P(ret_constant)) {
ret_constant = Z_REFVAL_P(ret_constant);
}
}
failure:
zend_string_release(class_name);
zend_string_free(constant_name);
if (ret_constant && Z_CONSTANT_P(ret_constant)) {
+4 -2
View File
@@ -563,11 +563,13 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
case IS_ARRAY:
smart_str_appends(str, "Array, ");
break;
case IS_OBJECT:
case IS_OBJECT: {
zend_string *class_name = Z_OBJ_HANDLER_P(arg, get_class_name)(Z_OBJ_P(arg));
smart_str_appends(str, "Object(");
smart_str_appends(str, ZSTR_VAL(Z_OBJCE_P(arg)->name));
smart_str_appends(str, ZSTR_VAL(class_name));
smart_str_appends(str, "), ");
break;
}
}
}
/* }}} */
+6
View File
@@ -1912,6 +1912,12 @@ ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *
zend_fetch_dimension_address_read_R(result, container, dim, IS_TMP_VAR);
}
ZEND_API void zend_fetch_dimension_by_zval_is(zval *result, zval *container, zval *dim, int dim_type)
{
zend_fetch_dimension_address_read(result, container, dim, dim_type, BP_VAR_IS);
}
static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type)
{
if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
+1
View File
@@ -296,6 +296,7 @@ ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, con
void zend_verify_abstract_class(zend_class_entry *ce);
ZEND_API void zend_fetch_dimension_by_zval(zval *result, zval *container, zval *dim);
ZEND_API void zend_fetch_dimension_by_zval_is(zval *result, zval *container, zval *dim, int dim_type);
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);
+6 -3
View File
@@ -295,8 +295,8 @@ void shutdown_executor(void) /* {{{ */
}
zend_stack_clean(&EG(user_error_handlers_error_reporting), NULL, 1);
zend_stack_clean(&EG(user_error_handlers), (void (*)(void *))ZVAL_DESTRUCTOR, 1);
zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_DESTRUCTOR, 1);
zend_stack_clean(&EG(user_error_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1);
zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1);
} zend_end_try();
zend_try {
@@ -397,7 +397,7 @@ void shutdown_executor(void) /* {{{ */
zend_shutdown_fpu();
#ifdef ZEND_DEBUG
#if ZEND_DEBUG
if (EG(ht_iterators_used) && !CG(unclean_shutdown)) {
zend_error(E_WARNING, "Leaked %" PRIu32 " hashtable iterators", EG(ht_iterators_used));
}
@@ -786,6 +786,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
if (func->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
if (func->common.fn_flags & ZEND_ACC_ABSTRACT) {
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
if (func->common.fn_flags & ZEND_ACC_DEPRECATED) {
+8 -4
View File
@@ -31,7 +31,8 @@ static zend_object_handlers zend_generator_handlers;
static zend_object *zend_generator_create(zend_class_entry *class_type);
static void zend_generator_cleanup_unfinished_execution(zend_generator *generator) /* {{{ */
static void zend_generator_cleanup_unfinished_execution(
zend_generator *generator, uint32_t catch_op_num) /* {{{ */
{
zend_execute_data *execute_data = generator->execute_data;
@@ -47,7 +48,7 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
EG(vm_stack_end) = generator->stack->end;
EG(vm_stack) = generator->stack;
zend_cleanup_unfinished_execution(execute_data, op_num, 0);
zend_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
generator->stack = EG(vm_stack);
generator->stack->top = EG(vm_stack_top);
@@ -85,7 +86,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
/* Some cleanups are only necessary if the generator was closed
* before it could finish execution (reach a return statement). */
if (UNEXPECTED(!finished_execution)) {
zend_generator_cleanup_unfinished_execution(generator);
zend_generator_cleanup_unfinished_execution(generator, 0);
}
/* Free closure object */
@@ -151,8 +152,11 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */
/* If a finally block was found we jump directly to it and
* resume the generator. */
if (finally_op_num) {
zval *fast_call = ZEND_CALL_VAR(ex, ex->func->op_array.opcodes[finally_op_end].op1.var);
zval *fast_call;
zend_generator_cleanup_unfinished_execution(generator, finally_op_num);
fast_call = ZEND_CALL_VAR(ex, ex->func->op_array.opcodes[finally_op_end].op1.var);
Z_OBJ_P(fast_call) = EG(exception);
EG(exception) = NULL;
fast_call->u2.lineno = (uint32_t)-1;
+3 -3
View File
@@ -1794,7 +1794,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->pDestructor = source->pDestructor;
if (source->nNumUsed == 0) {
target->u.flags = (source->u.flags & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED|HASH_FLAG_PERSISTENT)) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
target->u.flags = (source->u.flags & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED|HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
target->nTableMask = HT_MIN_MASK;
target->nNumUsed = 0;
target->nNumOfElements = 0;
@@ -1819,7 +1819,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = idx;
}
} else if (source->u.flags & HASH_FLAG_PACKED) {
target->u.flags = (source->u.flags & ~HASH_FLAG_PERSISTENT) | HASH_FLAG_APPLY_PROTECTION;
target->u.flags = (source->u.flags & ~(HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION;
target->nTableMask = source->nTableMask;
target->nNumUsed = source->nNumUsed;
target->nNumOfElements = source->nNumOfElements;
@@ -1842,7 +1842,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = idx;
}
} else {
target->u.flags = (source->u.flags & ~HASH_FLAG_PERSISTENT) | HASH_FLAG_APPLY_PROTECTION;
target->u.flags = (source->u.flags & ~(HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION;
target->nTableMask = source->nTableMask;
target->nNextFreeElement = source->nNextFreeElement;
target->nInternalPointer = HT_INVALID_IDX;
+34 -9
View File
@@ -319,6 +319,14 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
return 0;
}
#if 0
// This introduces BC break described at https://bugs.php.net/bug.php?id=72119
if (proto_arg_info->type_hint && proto_arg_info->allow_null && !fe_arg_info->allow_null) {
/* incompatible nullability */
return 0;
}
#endif
/* by-ref constraints on arguments are invariant */
if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) {
return 0;
@@ -483,6 +491,8 @@ static ZEND_COLD zend_string *zend_get_function_declaration(const zend_function
} else {
smart_str_appends(&str, "NULL");
}
} else if (arg_info->type_hint && arg_info->allow_null) {
smart_str_appends(&str, " = NULL");
}
if (++i < num_args) {
@@ -563,17 +573,31 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
}
if (child->common.prototype && (
child->common.prototype->common.fn_flags & (ZEND_ACC_ABSTRACT | ZEND_ACC_HAS_RETURN_TYPE)
child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT
)) {
if (UNEXPECTED(!zend_do_perform_implementation_check(child, child->common.prototype))) {
zend_string *method_prototype = zend_get_function_declaration(child->common.prototype);
zend_string *child_prototype = zend_get_function_declaration(child);
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", ZSTR_VAL(child_prototype), ZSTR_VAL(method_prototype));
}
} else if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) {
parent = child->common.prototype;
}
if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) {
int error_level;
const char *error_verb;
zend_string *method_prototype = zend_get_function_declaration(parent);
zend_string *child_prototype = zend_get_function_declaration(child);
zend_error(E_WARNING, "Declaration of %s should be compatible with %s", ZSTR_VAL(child_prototype), ZSTR_VAL(method_prototype));
if (child->common.prototype && (
child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT
)) {
error_level = E_COMPILE_ERROR;
error_verb = "must";
} else if ((parent->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) &&
(!(child->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
!zend_do_perform_type_hint_check(child, child->common.arg_info - 1, parent, parent->common.arg_info - 1))) {
error_level = E_COMPILE_ERROR;
error_verb = "must";
} else {
error_level = E_WARNING;
error_verb = "should";
}
zend_error(error_level, "Declaration of %s %s be compatible with %s", ZSTR_VAL(child_prototype), error_verb, ZSTR_VAL(method_prototype));
zend_string_free(child_prototype);
zend_string_free(method_prototype);
}
@@ -636,7 +660,8 @@ static void do_inherit_property(zend_property_info *parent_info, zend_string *ke
int parent_num = OBJ_PROP_TO_NUM(parent_info->offset);
int child_num = OBJ_PROP_TO_NUM(child_info->offset);
zval_ptr_dtor(&(ce->default_properties_table[parent_num]));
/* Don't keep default properties in GC (thry may be freed by opcache) */
zval_ptr_dtor_nogc(&(ce->default_properties_table[parent_num]));
ce->default_properties_table[parent_num] = ce->default_properties_table[child_num];
ZVAL_UNDEF(&ce->default_properties_table[child_num]);
child_info->offset = parent_info->offset;
+1 -1
View File
@@ -272,7 +272,7 @@ reserved_non_modifiers:
| T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO
| T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT | T_BREAK
| T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS
| T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER
| T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C
;
semi_reserved:
-1
View File
@@ -63,7 +63,6 @@ typedef struct _zend_heredoc_label {
} zend_heredoc_label;
BEGIN_EXTERN_C()
int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2);
ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state);
ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state);
ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename);
+43 -4
View File
@@ -552,6 +552,31 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
goto exit;
}
/* magic isset */
if ((type == BP_VAR_IS) && zobj->ce->__isset) {
zval tmp_object, tmp_result;
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
if (!((*guard) & IN_ISSET)) {
ZVAL_COPY(&tmp_object, object);
ZVAL_UNDEF(&tmp_result);
*guard |= IN_ISSET;
zend_std_call_issetter(&tmp_object, member, &tmp_result);
*guard &= ~IN_ISSET;
if (!zend_is_true(&tmp_result)) {
retval = &EG(uninitialized_zval);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_result);
goto exit;
}
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_result);
}
}
/* magic get */
if (zobj->ce->__get) {
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
@@ -710,13 +735,26 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
zval tmp;
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
if(offset == NULL) {
if (offset == NULL) {
/* [] construct */
ZVAL_UNDEF(&tmp);
ZVAL_NULL(&tmp);
offset = &tmp;
} else {
SEPARATE_ARG_IF_REF(offset);
}
if (type == BP_VAR_IS) {
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset);
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
return NULL;
}
if (!i_zend_is_true(rv)) {
zval_ptr_dtor(rv);
return &EG(uninitialized_zval);
}
zval_ptr_dtor(rv);
}
zend_call_method_with_1_params(object, ce, NULL, "offsetget", rv, offset);
zval_ptr_dtor(offset);
@@ -1030,6 +1068,7 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend_string *method_name, int is_static) /* {{{ */
{
size_t mname_len;
zend_op_array *func;
zend_function *fbc = is_static ? ce->__callstatic : ce->__call;
@@ -1062,8 +1101,8 @@ ZEND_API zend_function *zend_get_call_trampoline_func(zend_class_entry *ce, zend
//??? keep compatibility for "\0" characters
//??? see: Zend/tests/bug46238.phpt
if (UNEXPECTED(strlen(ZSTR_VAL(method_name)) != ZSTR_LEN(method_name))) {
func->function_name = zend_string_init(ZSTR_VAL(method_name), strlen(ZSTR_VAL(method_name)), 0);
if (UNEXPECTED((mname_len = strlen(ZSTR_VAL(method_name))) != ZSTR_LEN(method_name))) {
func->function_name = zend_string_init(ZSTR_VAL(method_name), mname_len, 0);
} else {
func->function_name = zend_string_copy(method_name);
}
+4 -8
View File
@@ -44,12 +44,9 @@ ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)
ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects)
{
if (objects->top > 1) {
zend_object **obj_ptr = objects->object_buckets + 1;
zend_object **end = objects->object_buckets + objects->top;
do {
zend_object *obj = *obj_ptr;
uint32_t i;
for (i = 1; i < objects->top; i++) {
zend_object *obj = objects->object_buckets[i];
if (IS_OBJ_VALID(obj)) {
if (!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
@@ -58,8 +55,7 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects)
GC_REFCOUNT(obj)--;
}
}
obj_ptr++;
} while (obj_ptr != end);
}
}
}
+6 -1
View File
@@ -597,7 +597,9 @@ try_again:
if (obj_ht) {
zval arr;
if (!Z_OBJCE_P(op)->default_properties_count && obj_ht == Z_OBJ_P(op)->properties) {
if (!Z_OBJCE_P(op)->default_properties_count &&
obj_ht == Z_OBJ_P(op)->properties &&
!ZEND_HASH_GET_APPLY_COUNT(Z_OBJ_P(op)->properties)) {
/* fast copy */
if (EXPECTED(Z_OBJ_P(op)->handlers == &std_object_handlers)) {
ZVAL_ARR(&arr, obj_ht);
@@ -2925,6 +2927,9 @@ ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const c
if (i == needle_len) {
return p;
}
if (UNEXPECTED(p == end)) {
return NULL;
}
p += td[(unsigned char)(p[needle_len])];
}
+3 -3
View File
@@ -4416,7 +4416,7 @@ ZEND_API double zend_hex_strtod(const char *str, const char **endptr)
int any = 0;
double value = 0;
if (strlen(str) < 2) {
if (s[0] == '\0' || s[1] == '\0') {
if (endptr != NULL) {
*endptr = str;
}
@@ -4456,7 +4456,7 @@ ZEND_API double zend_oct_strtod(const char *str, const char **endptr)
double value = 0;
int any = 0;
if (strlen(str) < 1) {
if (str[0] == '\0') {
if (endptr != NULL) {
*endptr = str;
}
@@ -4491,7 +4491,7 @@ ZEND_API double zend_bin_strtod(const char *str, const char **endptr)
double value = 0;
int any = 0;
if (strlen(str) < 2) {
if (str[0] == '\0' || str[1] == '\0') {
if (endptr != NULL) {
*endptr = str;
}
+2 -1
View File
@@ -915,6 +915,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
if (pbuffer == NULL) {
CloseHandle(hLink);
return -1;
}
if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
@@ -1186,7 +1187,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
int add_slash;
void *tmp;
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
#ifdef ZEND_WIN32
_set_errno(EINVAL);
#else
+118 -126
View File
@@ -744,13 +744,18 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
&& EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
if (UNEXPECTED(zptr == &EG(error_zval))) {
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
binary_op(zptr, zptr, value);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
}
} else {
zend_assign_op_overloaded_property(object, property, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), value, binary_op, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
@@ -1150,28 +1155,32 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
}
/* here we are sure we are dealing with an object */
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
&& EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
if (EXPECTED(Z_TYPE_P(zptr) == IS_LONG)) {
if (inc) {
fast_long_increment_function(zptr);
} else {
fast_long_decrement_function(zptr);
if (UNEXPECTED(zptr == &EG(error_zval))) {
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
}
} else {
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
if (inc) {
increment_function(zptr);
if (EXPECTED(Z_TYPE_P(zptr) == IS_LONG)) {
if (inc) {
fast_long_increment_function(zptr);
} else {
fast_long_decrement_function(zptr);
}
} else {
decrement_function(zptr);
ZVAL_DEREF(zptr);
SEPARATE_ZVAL_NOREF(zptr);
if (inc) {
increment_function(zptr);
} else {
decrement_function(zptr);
}
}
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
}
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), zptr);
}
} else {
zend_pre_incdec_overloaded_property(object, property, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), inc, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL));
@@ -1232,22 +1241,25 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
&& EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) {
if (EXPECTED(Z_TYPE_P(zptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr);
if (inc) {
fast_long_increment_function(zptr);
} else {
fast_long_decrement_function(zptr);
}
if (UNEXPECTED(zptr == &EG(error_zval))) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr);
zval_opt_copy_ctor(zptr);
if (inc) {
increment_function(zptr);
if (EXPECTED(Z_TYPE_P(zptr) == IS_LONG)) {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr);
if (inc) {
fast_long_increment_function(zptr);
} else {
fast_long_decrement_function(zptr);
}
} else {
decrement_function(zptr);
ZVAL_DEREF(zptr);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr);
zval_opt_copy_ctor(zptr);
if (inc) {
increment_function(zptr);
} else {
decrement_function(zptr);
}
}
}
} else {
@@ -4287,27 +4299,24 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR, ANY)
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
(Z_VAR_FLAGS_P(varptr) & IS_VAR_RET_REF)) &&
(Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) {
if (EXPECTED(Z_ISREF_P(varptr) ||
((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
(opline->extended_value & ZEND_ARG_SEND_SILENT) :
ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num
)))) {
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, varptr);
ZVAL_MAKE_REF(varptr);
} else {
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
SAVE_OPLINE();
zend_error(E_NOTICE, "Only variables should be passed by reference");
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, varptr);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_NEXT_OPCODE();
}
SAVE_OPLINE();
zend_error(E_NOTICE, "Only variables should be passed by reference");
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, varptr);
ZEND_VM_NEXT_OPCODE();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
@@ -4413,7 +4422,7 @@ ZEND_VM_C_LABEL(send_again):
zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_REFCOUNT_P(args) > 1) {
uint32_t i;
int separate = 0;
@@ -4425,7 +4434,7 @@ ZEND_VM_C_LABEL(send_again):
}
}
if (separate) {
zval_copy_ctor(args);
SEPARATE_ARRAY(args);
ht = Z_ARRVAL_P(args);
}
}
@@ -4439,7 +4448,7 @@ ZEND_VM_C_LABEL(send_again):
top = ZEND_CALL_ARG(EX(call), arg_num);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
if (!Z_IMMUTABLE_P(args)) {
if (Z_REFCOUNT_P(args) == 1) {
ZVAL_MAKE_REF(arg);
Z_ADDREF_P(arg);
ZVAL_REF(top, Z_REF_P(arg));
@@ -4582,6 +4591,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
EX(call)->func = (zend_function*)&zend_pass_function;
EX(call)->called_scope = NULL;
Z_OBJ(EX(call)->This) = NULL;
ZEND_SET_CALL_INFO(EX(call), ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
} else {
uint32_t arg_num;
HashTable *ht;
@@ -4591,22 +4601,6 @@ ZEND_VM_C_LABEL(send_array):
ht = Z_ARRVAL_P(args);
zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht));
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
int separate = 0;
/* check if any of arguments are going to be passed by reference */
for (arg_num = 0; arg_num < zend_hash_num_elements(ht); arg_num++) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num + 1)) {
separate = 1;
break;
}
}
if (separate) {
zval_copy_ctor(args);
ht = Z_ARRVAL_P(args);
}
}
arg_num = 1;
param = ZEND_CALL_ARG(EX(call), 1);
ZEND_HASH_FOREACH_VAL(ht, arg) {
@@ -4629,24 +4623,18 @@ ZEND_VM_C_LABEL(send_array):
EX(call)->func = (zend_function*)&zend_pass_function;
EX(call)->called_scope = NULL;
Z_OBJ(EX(call)->This) = NULL;
ZEND_SET_CALL_INFO(EX(call), ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
break;
}
ZVAL_NEW_REF(arg, arg);
}
Z_ADDREF_P(arg);
} else{
} else {
if (Z_ISREF_P(arg) &&
!(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
/* don't separate references for __call */
arg = Z_REFVAL_P(arg);
}
if (Z_OPT_REFCOUNTED_P(arg)) {
Z_ADDREF_P(arg);
}
}
ZVAL_COPY_VALUE(param, arg);
ZVAL_COPY(param, arg);
ZEND_CALL_NUM_ARGS(EX(call))++;
arg_num++;
param++;
@@ -4666,46 +4654,35 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
arg = GET_OP1_ZVAL_PTR(BP_VAR_R);
param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
if (UNEXPECTED(!Z_ISREF_P(arg))) {
if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) {
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
opline->op2.num,
EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
EX(call)->func->common.scope ? "::" : "",
ZSTR_VAL(EX(call)->func->common.function_name));
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, opline->op2.num)) {
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
opline->op2.num,
EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
EX(call)->func->common.scope ? "::" : "",
ZSTR_VAL(EX(call)->func->common.function_name));
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
}
if (Z_OBJ(EX(call)->This)) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
ZVAL_UNDEF(param);
EX(call)->func = (zend_function*)&zend_pass_function;
EX(call)->called_scope = NULL;
Z_OBJ(EX(call)->This) = NULL;
FREE_OP1();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
ZVAL_NEW_REF(arg, arg);
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
}
Z_ADDREF_P(arg);
if (Z_OBJ(EX(call)->This)) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
ZVAL_UNDEF(param);
EX(call)->func = (zend_function*)&zend_pass_function;
EX(call)->called_scope = NULL;
Z_OBJ(EX(call)->This) = NULL;
ZEND_SET_CALL_INFO(EX(call), ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
FREE_OP1();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
if (Z_ISREF_P(arg) &&
!(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
/* don't separate references for __call */
arg = Z_REFVAL_P(arg);
}
if (Z_OPT_REFCOUNTED_P(arg)) {
Z_ADDREF_P(arg);
}
}
ZVAL_COPY_VALUE(param, arg);
ZVAL_COPY(param, arg);
FREE_OP1();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -4724,7 +4701,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num)))) {
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, NULL, CACHE_ADDR(opline->op2.num)) || EG(exception))) {
HANDLE_EXCEPTION();
}
}
@@ -4762,7 +4739,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
zval *default_value = EX_CONSTANT(opline->op2);
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, default_value, CACHE_ADDR(Z_CACHE_SLOT_P(default_value))))) {
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, default_value, CACHE_ADDR(Z_CACHE_SLOT_P(default_value))) || EG(exception))) {
HANDLE_EXCEPTION();
}
}
@@ -4891,7 +4868,7 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
} else if ((OP1_TYPE & (IS_VAR|IS_CV)) && UNEXPECTED(Z_ISREF_P(op1))) {
} else if ((OP1_TYPE & IS_VAR) && UNEXPECTED(Z_ISREF_P(op1))) {
/* Don't keep lock on reference, lock the value instead */
if (UNEXPECTED(Z_REFCOUNT_P(op1) == 1)) {
ZVAL_UNREF(op1);
@@ -6766,9 +6743,10 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
} else if (OP1_TYPE == IS_VAR && ref) {
zend_reference *r = Z_REF_P(ref);
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
efree_size(r, sizeof(zend_reference));
} else if (Z_OPT_REFCOUNTED_P(value)) {
Z_ADDREF_P(value);
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -6806,9 +6784,10 @@ ZEND_VM_HANDLER(169, ZEND_COALESCE, CONST|TMP|VAR|CV, ANY)
} else if (OP1_TYPE == IS_VAR && ref) {
zend_reference *r = Z_REF_P(ref);
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
if (UNEXPECTED(--GC_REFCOUNT(r) == 0)) {
efree_size(r, sizeof(zend_reference));
} else if (Z_OPT_REFCOUNTED_P(value)) {
Z_ADDREF_P(value);
}
}
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
@@ -6823,30 +6802,36 @@ ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY)
USE_OPLINE
zend_free_op free_op1;
zval *value;
zval *result = EX_VAR(opline->result.var);
value = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
SAVE_OPLINE();
GET_OP1_UNDEF_CV(value, BP_VAR_R);
ZVAL_NULL(EX_VAR(opline->result.var));
ZVAL_NULL(result);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && Z_ISREF_P(value)) {
ZVAL_COPY(EX_VAR(opline->result.var), Z_REFVAL_P(value));
if (OP1_TYPE == IS_VAR) {
if (OP1_TYPE == IS_CV) {
ZVAL_DEREF(value);
ZVAL_COPY(result, value);
} else if (OP1_TYPE == IS_VAR) {
if (UNEXPECTED(Z_ISREF_P(value))) {
ZVAL_COPY_VALUE(result, Z_REFVAL_P(value));
if (UNEXPECTED(Z_DELREF_P(value) == 0)) {
efree_size(Z_REF_P(value), sizeof(zend_reference));
} else if (Z_OPT_REFCOUNTED_P(result)) {
Z_ADDREF_P(result);
}
} else {
ZVAL_COPY_VALUE(result, value);
}
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
ZVAL_COPY_VALUE(result, value);
if (OP1_TYPE == IS_CONST) {
if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) {
zval_copy_ctor_func(EX_VAR(opline->result.var));
zval_copy_ctor_func(result);
}
} else if (OP1_TYPE == IS_CV) {
if (Z_OPT_REFCOUNTED_P(value)) Z_ADDREF_P(value);
}
}
ZEND_VM_NEXT_OPCODE();
@@ -7289,11 +7274,12 @@ ZEND_VM_HANDLER(156, ZEND_SEPARATE, VAR, UNUSED)
if (UNEXPECTED(Z_ISREF_P(var_ptr))) {
if (UNEXPECTED(Z_REFCOUNT_P(var_ptr) == 1)) {
ZVAL_UNREF(var_ptr);
} else if (!(Z_VAR_FLAGS_P(var_ptr) & IS_VAR_RET_REF)) {
Z_DELREF_P(var_ptr);
ZVAL_COPY(var_ptr, Z_REFVAL_P(var_ptr));
}
} else if (Z_COPYABLE_P(var_ptr) && Z_REFCOUNT_P(var_ptr) > 1) {
Z_DELREF_P(var_ptr);
ZVAL_DUP(EX_VAR(opline->op1.var), var_ptr);
}
ZEND_VM_NEXT_OPCODE();
}
@@ -7451,6 +7437,12 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
SAVE_OPLINE();
val = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
FREE_OP1();
HANDLE_EXCEPTION();
}
if (Z_TYPE_P(val) == IS_ARRAY) {
ZVAL_COPY_VALUE(&generator->values, val);
if (OP1_TYPE != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
+601 -482
View File
File diff suppressed because it is too large. Load diff
+6 -1
View File
@@ -2672,10 +2672,14 @@ AC_DEFUN([PHP_CONFIG_NICE],[
EOF
clean_configure_args=$ac_configure_args
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
eval val=\$$var
if test -n "$val"; then
echo "$var='$val' \\" >> $1
if test `expr "X$ac_configure_args" : ".*${var}.*"` != 0; then
clean_configure_args=$(echo $clean_configure_args | sed -e "s/'$var=$val'//")
fi
fi
done
@@ -2685,7 +2689,8 @@ EOF
else
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
fi
for arg in $ac_configure_args; do
for arg in $clean_configure_args; do
if test `expr -- $arg : "'.*"` = 0; then
if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then
continue;
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=5
PHP_EXTRA_VERSION="RC1"
PHP_RELEASE_VERSION=9
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`
+24 -2
View File
@@ -207,6 +207,21 @@ static void php_str2num(bc_num *num, char *str)
}
/* }}} */
/* {{{ split_bc_num
Convert to bc_num detecting scale */
static bc_num split_bc_num(bc_num num) {
bc_num newnum;
if (num->n_refs >= 1) {
return num;
}
newnum = _bc_new_num_ex(0, 0, 0);
*newnum = *num;
newnum->n_refs = 1;
num->n_refs--;
return newnum;
}
/* }}} */
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
Returns the sum of two arbitrary precision numbers */
PHP_FUNCTION(bcadd)
@@ -233,6 +248,7 @@ PHP_FUNCTION(bcadd)
bc_add (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -270,6 +286,7 @@ PHP_FUNCTION(bcsub)
bc_sub (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -307,6 +324,7 @@ PHP_FUNCTION(bcmul)
bc_multiply (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -345,6 +363,7 @@ PHP_FUNCTION(bcdiv)
switch (bc_divide(first, second, &result, scale)) {
case 0: /* OK */
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
RETVAL_STR(bc_num2str(result));
@@ -420,8 +439,9 @@ PHP_FUNCTION(bcpowmod)
scale_int = (int) ((int)scale < 0 ? 0 : scale);
if (bc_raisemod(first, second, mod, &result, scale_int) != -1) {
if (result->n_scale > scale) {
result->n_scale = (int)scale;
if (result->n_scale > scale_int) {
result = split_bc_num(result);
result->n_scale = scale_int;
}
RETVAL_STR(bc_num2str(result));
} else {
@@ -462,6 +482,7 @@ PHP_FUNCTION(bcpow)
bc_raise (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -496,6 +517,7 @@ PHP_FUNCTION(bcsqrt)
if (bc_sqrt (&result, scale) != 0) {
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
RETVAL_STR(bc_num2str(result));
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
--SKIPIF--
<?php
if(!extension_loaded("bcmath")) print "skip";
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip valid only for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod(1, "A", 128, -200));
var_dump(bcpowmod(1, 1.2, 1, 1));
?>
--EXPECTF--
string(1) "1"
string(3) "0.0"
bc math warning: non-zero scale in exponent
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
--SKIPIF--
<?php
if(!extension_loaded("bcmath")) print "skip";
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not valid for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod(1, "A", 128, -200));
var_dump(bcpowmod(1, 1.2, 1, 1));
?>
--EXPECTF--
string(1) "1"
bc math warning: non-zero scale in exponent
string(3) "0.0"
+5 -1
View File
@@ -148,7 +148,11 @@ static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count)
just_read = BZ2_bzread(self->bz_file, buf, to_read);
if (just_read < 1) {
stream->eof = 0 == just_read;
/* it is not safe to keep reading after an error, see #72613 */
stream->eof = 1;
if (just_read < 0) {
return -1;
}
break;
}
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #72447: Type Confusion in php_bz2_filter_create()
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php
$input = "AAAAAAAA";
$param = array('blocks' => $input);
$fp = fopen('testfile', 'w');
stream_filter_append($fp, 'bzip2.compress', STREAM_FILTER_WRITE, $param);
fclose($fp);
?>
--EXPECTF--
Warning: stream_filter_append(): Invalid parameter given for number of blocks to allocate. (0) in %s%ebug72447.php on line %d
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #72613 (Inadequate error handling in bzread())
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php
$fp = bzopen(__DIR__.'/72613.bz2', 'r');
if ($fp === FALSE) {
exit("ERROR: bzopen()");
}
$data = "";
while (!feof($fp)) {
$res = bzread($fp);
if ($res === FALSE) {
exit("ERROR: bzread()");
}
$data .= $res;
}
bzclose($fp);
?>
DONE
--EXPECT--
DONE
+7
View File
@@ -1007,6 +1007,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
tzset();
ttstamp = timestamp;
tmv = localtime(&ttstamp);
#if ZEND_ENABLE_ZVAL_LONG64
/* Invalid after 23:59:59, December 31, 3000, UTC */
if (!tmv) {
php_error_docref(NULL, E_WARNING, "Invalid timestamp " ZEND_LONG_FMT, timestamp);
RETURN_FALSE;
}
#endif
memset(&systime, 0, sizeof(systime));
systime.wDay = tmv->tm_mday;
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72498 variant_date_from_timestamp null dereference
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
if (PHP_INT_SIZE != 8) print "skip 64-bit only";
?>
--FILE--
<?php
$v1 = PHP_INT_MAX;
var_dump(variant_date_from_timestamp($v1));
?>
--EXPECTF--
Warning: variant_date_from_timestamp(): Invalid timestamp %d in %sbug72498.php on line %d
bool(false)
+197 -14
View File
@@ -567,6 +567,13 @@ PHP_MINFO_FUNCTION(curl)
#endif
#if LIBCURL_VERSION_NUM >= 0x072600 /* 7.38.0 */
{"GSSAPI", CURL_VERSION_GSSAPI},
#endif
#if LIBCURL_VERSION_NUM >= 0x072800 /* 7.40.0 */
{"KERBEROS5", CURL_VERSION_KERBEROS5},
{"UNIX_SOCKETS", CURL_VERSION_UNIX_SOCKETS},
#endif
#if LIBCURL_VERSION_NUM >= 0x072f00 /* 7.47.0 */
{"PSL", CURL_VERSION_PSL},
#endif
{NULL, 0}
};
@@ -847,11 +854,6 @@ 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);
@@ -860,9 +862,6 @@ 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 */
@@ -892,9 +891,6 @@ 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);
@@ -999,6 +995,7 @@ PHP_MINIT_FUNCTION(curl)
#endif
#if LIBCURL_VERSION_NUM >= 0x071000 /* Available since 7.16.0 */
REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT_BADFILE);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_SESSIONID_CACHE);
REGISTER_CURL_CONSTANT(CURLMOPT_PIPELINING);
#endif
@@ -1056,6 +1053,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLPAUSE_SEND_CONT);
REGISTER_CURL_CONSTANT(CURL_READFUNC_PAUSE);
REGISTER_CURL_CONSTANT(CURL_WRITEFUNC_PAUSE);
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4A);
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5_HOSTNAME);
#endif
#if LIBCURL_VERSION_NUM >= 0x071202 /* Available since 7.18.2 */
@@ -1088,6 +1088,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_PROXYPASSWORD);
REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERNAME);
REGISTER_CURL_CONSTANT(CURLOPT_USERNAME);
REGISTER_CURL_CONSTANT(CURL_REDIR_POST_301);
REGISTER_CURL_CONSTANT(CURL_REDIR_POST_302);
REGISTER_CURL_CONSTANT(CURL_REDIR_POST_ALL);
#endif
#if LIBCURL_VERSION_NUM >= 0x071303 /* Available since 7.19.3 */
@@ -1117,6 +1120,12 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLPROTO_SFTP);
REGISTER_CURL_CONSTANT(CURLPROTO_TELNET);
REGISTER_CURL_CONSTANT(CURLPROTO_TFTP);
REGISTER_CURL_CONSTANT(CURLPROXY_HTTP_1_0);
REGISTER_CURL_CONSTANT(CURLFTP_CREATE_DIR);
REGISTER_CURL_CONSTANT(CURLFTP_CREATE_DIR_NONE);
REGISTER_CURL_CONSTANT(CURLFTP_CREATE_DIR_RETRY);
#endif
#if LIBCURL_VERSION_NUM >= 0x071306 /* Available since 7.19.6 */
@@ -1152,8 +1161,8 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_PLAY);
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECEIVE);
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECORD);
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SETUP);
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SET_PARAMETER);
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SETUP);
REGISTER_CURL_CONSTANT(CURL_RTSPREQ_TEARDOWN);
#endif
@@ -1196,6 +1205,7 @@ PHP_MINIT_FUNCTION(curl)
#endif
#if LIBCURL_VERSION_NUM >= 0x071600 /* Available since 7.22.0 */
REGISTER_CURL_CONSTANT(CURLAUTH_NTLM_WB);
REGISTER_CURL_CONSTANT(CURLGSSAPI_DELEGATION_FLAG);
REGISTER_CURL_CONSTANT(CURLGSSAPI_DELEGATION_POLICY_FLAG);
REGISTER_CURL_CONSTANT(CURLOPT_GSSAPI_DELEGATION);
@@ -1215,18 +1225,119 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLSSLOPT_ALLOW_BEAST);
#endif
#if LIBCURL_VERSION_NUM >= 0x071901 /* Available since 7.25.1 */
REGISTER_CURL_CONSTANT(CURL_REDIR_POST_303);
#endif
#if LIBCURL_VERSION_NUM >= 0x071c00 /* Available since 7.28.0 */
REGISTER_CURL_CONSTANT(CURLSSH_AUTH_AGENT);
#endif
#if LIBCURL_VERSION_NUM >= 0x071e00 /* Available since 7.30.0 */
REGISTER_CURL_CONSTANT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE);
REGISTER_CURL_CONSTANT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE);
REGISTER_CURL_CONSTANT(CURLMOPT_MAX_HOST_CONNECTIONS);
REGISTER_CURL_CONSTANT(CURLMOPT_MAX_PIPELINE_LENGTH);
REGISTER_CURL_CONSTANT(CURLMOPT_MAX_TOTAL_CONNECTIONS);
#endif
#if LIBCURL_VERSION_NUM >= 0x071f00 /* Available since 7.31.0 */
REGISTER_CURL_CONSTANT(CURLOPT_SASL_IR);
#endif
#if LIBCURL_VERSION_NUM >= 0x072100 /* Available since 7.33.0 */
REGISTER_CURL_CONSTANT(CURLOPT_DNS_INTERFACE);
REGISTER_CURL_CONSTANT(CURLOPT_DNS_LOCAL_IP4);
REGISTER_CURL_CONSTANT(CURLOPT_DNS_LOCAL_IP6);
REGISTER_CURL_CONSTANT(CURLOPT_XOAUTH2_BEARER);
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2_0);
REGISTER_CURL_CONSTANT(CURL_VERSION_HTTP2);
#endif
#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */
REGISTER_CURL_CONSTANT(CURLOPT_LOGIN_OPTIONS);
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_0);
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_1);
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_2);
#endif
#if LIBCURL_VERSION_NUM >= 0x072B00 /* Available since 7.43.0 */
#if LIBCURL_VERSION_NUM >= 0x072400 /* Available since 7.36.0 */
REGISTER_CURL_CONSTANT(CURLOPT_EXPECT_100_TIMEOUT_MS);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_ENABLE_ALPN);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_ENABLE_NPN);
#endif
#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */
REGISTER_CURL_CONSTANT(CURLHEADER_SEPARATE);
REGISTER_CURL_CONSTANT(CURLHEADER_UNIFIED);
REGISTER_CURL_CONSTANT(CURLOPT_HEADEROPT);
REGISTER_CURL_CONSTANT(CURLOPT_PROXYHEADER);
#endif
#if LIBCURL_VERSION_NUM >= 0x072600 /* Available since 7.38.0 */
REGISTER_CURL_CONSTANT(CURLAUTH_NEGOTIATE);
#endif
#if LIBCURL_VERSION_NUM >= 0x072700 /* Available since 7.39.0 */
REGISTER_CURL_CONSTANT(CURLOPT_PINNEDPUBLICKEY);
#endif
#if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */
REGISTER_CURL_CONSTANT(CURLOPT_UNIX_SOCKET_PATH);
REGISTER_CURL_CONSTANT(CURLPROTO_SMB);
REGISTER_CURL_CONSTANT(CURLPROTO_SMBS);
#endif
#if LIBCURL_VERSION_NUM >= 0x072900 /* Available since 7.41.0 */
REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYSTATUS);
#endif
#if LIBCURL_VERSION_NUM >= 0x072a00 /* Available since 7.42.0 */
REGISTER_CURL_CONSTANT(CURLOPT_PATH_AS_IS);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_FALSESTART);
#endif
#if LIBCURL_VERSION_NUM >= 0x072b00 /* Available since 7.43.0 */
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2);
REGISTER_CURL_CONSTANT(CURLOPT_PIPEWAIT);
REGISTER_CURL_CONSTANT(CURLOPT_PROXY_SERVICE_NAME);
REGISTER_CURL_CONSTANT(CURLOPT_SERVICE_NAME);
REGISTER_CURL_CONSTANT(CURLPIPE_NOTHING);
REGISTER_CURL_CONSTANT(CURLPIPE_HTTP1);
REGISTER_CURL_CONSTANT(CURLPIPE_MULTIPLEX);
#endif
#if LIBCURL_VERSION_NUM >= 0x072c00 /* Available since 7.44.0 */
REGISTER_CURL_CONSTANT(CURLSSLOPT_NO_REVOKE);
#endif
#if LIBCURL_VERSION_NUM >= 0x072d00 /* Available since 7.45.0 */
REGISTER_CURL_CONSTANT(CURLOPT_DEFAULT_PROTOCOL);
#endif
#if LIBCURL_VERSION_NUM >= 0x072e00 /* Available since 7.46.0 */
REGISTER_CURL_CONSTANT(CURLOPT_STREAM_WEIGHT);
#endif
#if LIBCURL_VERSION_NUM >= 0x072f00 /* Available since 7.47.0 */
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2TLS);
#endif
#if LIBCURL_VERSION_NUM >= 0x073000 /* Available since 7.48.0 */
REGISTER_CURL_CONSTANT(CURLOPT_TFTP_NO_OPTIONS);
#endif
#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
REGISTER_CURL_CONSTANT(CURLOPT_CONNECT_TO);
REGISTER_CURL_CONSTANT(CURLOPT_TCP_FASTOPEN);
#endif
#if CURLOPT_FTPASCII != 0
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
#endif
@@ -2149,7 +2260,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
case CURLOPT_CERTINFO:
#endif
#if LIBCURL_VERSION_NUM >= 0x071304 /* Available since 7.19.4 */
case CURLOPT_NOPROXY:
case CURLOPT_PROTOCOLS:
case CURLOPT_REDIR_PROTOCOLS:
case CURLOPT_SOCKS5_GSSAPI_NEC:
@@ -2179,6 +2289,36 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
case CURLOPT_TCP_KEEPIDLE:
case CURLOPT_TCP_KEEPINTVL:
#endif
#if LIBCURL_VERSION_NUM >= 0x071f00 /* Available since 7.31.0 */
case CURLOPT_SASL_IR:
#endif
#if LIBCURL_VERSION_NUM >= 0x072400 /* Available since 7.36.0 */
case CURLOPT_EXPECT_100_TIMEOUT_MS:
case CURLOPT_SSL_ENABLE_ALPN:
case CURLOPT_SSL_ENABLE_NPN:
#endif
#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */
case CURLOPT_HEADEROPT:
#endif
#if LIBCURL_VERSION_NUM >= 0x072900 /* Available since 7.41.0 */
case CURLOPT_SSL_VERIFYSTATUS:
#endif
#if LIBCURL_VERSION_NUM >= 0x072a00 /* Available since 7.42.0 */
case CURLOPT_PATH_AS_IS:
case CURLOPT_SSL_FALSESTART:
#endif
#if LIBCURL_VERSION_NUM >= 0x072b00 /* Available since 7.43.0 */
case CURLOPT_PIPEWAIT:
#endif
#if LIBCURL_VERSION_NUM >= 0x072e00 /* Available since 7.46.0 */
case CURLOPT_STREAM_WEIGHT:
#endif
#if LIBCURL_VERSION_NUM >= 0x073000 /* Available since 7.48.0 */
case CURLOPT_TFTP_NO_OPTIONS:
#endif
#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */
case CURLOPT_TCP_FASTOPEN:
#endif
#if CURLOPT_MUTE != 0
case CURLOPT_MUTE:
#endif
@@ -2240,6 +2380,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
case CURLOPT_USERNAME:
#endif
#if LIBCURL_VERSION_NUM >= 0x071304 /* Available since 7.19.4 */
case CURLOPT_NOPROXY:
case CURLOPT_SOCKS5_GSSAPI_SERVICE:
#endif
#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
@@ -2262,6 +2403,19 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
#endif
#if LIBCURL_VERSION_NUM >= 0x071900 /* Available since 7.25.0 */
case CURLOPT_MAIL_AUTH:
#endif
#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */
case CURLOPT_LOGIN_OPTIONS:
#endif
#if LIBCURL_VERSION_NUM >= 0x072700 /* Available since 7.39.0 */
case CURLOPT_PINNEDPUBLICKEY:
#endif
#if LIBCURL_VERSION_NUM >= 0x072b00 /* Available since 7.43.0 */
case CURLOPT_PROXY_SERVICE_NAME:
case CURLOPT_SERVICE_NAME:
#endif
#if LIBCURL_VERSION_NUM >= 0x072d00 /* Available since 7.45.0 */
case CURLOPT_DEFAULT_PROTOCOL:
#endif
{
zend_string *str = zval_get_string(zvalue);
@@ -2280,6 +2434,15 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
case CURLOPT_RTSP_SESSION_ID:
#endif
#if LIBCURL_VERSION_NUM >= 0x072100 /* Available since 7.33.0 */
case CURLOPT_DNS_INTERFACE:
case CURLOPT_DNS_LOCAL_IP4:
case CURLOPT_DNS_LOCAL_IP6:
case CURLOPT_XOAUTH2_BEARER:
#endif
#if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */
case CURLOPT_UNIX_SOCKET_PATH:
#endif
#if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */
case CURLOPT_KRBLEVEL:
#else
@@ -2424,6 +2587,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
#endif
#if LIBCURL_VERSION_NUM >= 0x071503 /* Available since 7.21.3 */
case CURLOPT_RESOLVE:
#endif
#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */
case CURLOPT_PROXYHEADER:
#endif
#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */
case CURLOPT_CONNECT_TO:
#endif
{
zval *current;
@@ -2462,6 +2631,16 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
case CURLOPT_RESOLVE:
name = "CURLOPT_RESOLVE";
break;
#endif
#if LIBCURL_VERSION_NUM >= 0x072500 /* Available since 7.37.0 */
case CURLOPT_PROXYHEADER:
name = "CURLOPT_PROXYHEADER";
break;
#endif
#if LIBCURL_VERSION_NUM >= 0x073100 /* Available since 7.49.0 */
case CURLOPT_CONNECT_TO:
name = "CURLOPT_CONNECT_TO";
break;
#endif
}
php_error_docref(NULL, E_WARNING, "You must pass either an object or an array with the %s argument", name);
@@ -3416,6 +3595,10 @@ PHP_FUNCTION(curl_unescape)
RETURN_FALSE;
}
if (str_len > INT_MAX) {
RETURN_FALSE;
}
if ((out = curl_easy_unescape(ch->cp, str, str_len, &out_len))) {
RETVAL_STRINGL(out, out_len);
curl_free(out);
+7
View File
@@ -416,6 +416,13 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue,
#endif
#if LIBCURL_VERSION_NUM >= 0x071003 /* 7.16.3 */
case CURLMOPT_MAXCONNECTS:
#endif
#if LIBCURL_VERSION_NUM >= 0x071e00 /* 7.30.0 */
case CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE:
case CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE:
case CURLMOPT_MAX_HOST_CONNECTIONS:
case CURLMOPT_MAX_PIPELINE_LENGTH:
case CURLMOPT_MAX_TOTAL_CONNECTIONS:
#endif
error = curl_multi_setopt(mh->multi, option, zval_get_long(zvalue));
break;
+7 -1
View File
@@ -8,13 +8,19 @@ include 'skipif.inc';
--FILE--
<?php
$ch = curl_init('http://www.google.com/');
include 'server.inc';
$host = curl_cli_server_start();
$url = "{$host}/get.php";
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_INFILESIZE => 1,
CURLOPT_HTTPHEADER => array(
'Expect:',
'Content-Length: 1',
),
CURLOPT_READFUNCTION => 'curl_read',
+6 -1
View File
@@ -7,8 +7,12 @@ include 'skipif.inc';
?>
--FILE--
<?php
include 'server.inc';
$host = curl_cli_server_start();
$ch = curl_init('http://www.google.com/');
$url = "{$host}/get.php";
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
@@ -16,6 +20,7 @@ curl_setopt_array($ch, array(
CURLOPT_INFILESIZE => filesize(__FILE__),
CURLOPT_INFILE => fopen(__FILE__, 'r'),
CURLOPT_HTTPHEADER => array(
'Expect:',
'Content-Length: 1',
),
CURLOPT_READFUNCTION => 'curl_read',
+3
View File
@@ -42,6 +42,9 @@ SSPI => Yes
TLS-SRP => No
HTTP2 => No
GSSAPI => No
KERBEROS5 => Yes
UNIX_SOCKETS => No
PSL => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host => %s-pc-win32
SSL Version => OpenSSL/%s
+87 -1644
View File
File diff suppressed because it is too large. Load diff
+28 -28
View File
@@ -310,33 +310,33 @@ void timelib_dump_rel_time(timelib_rel_time *d)
timelib_long timelib_parse_tz_cor(char **ptr)
{
char *begin = *ptr, *end;
timelib_long tmp;
char *begin = *ptr, *end;
timelib_long tmp;
while (isdigit(**ptr) || **ptr == ':') {
++*ptr;
}
end = *ptr;
switch (end - begin) {
case 1:
case 2:
return HOUR(strtol(begin, NULL, 10));
break;
case 3:
case 4:
if (begin[1] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10);
return tmp;
} else if (begin[2] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
} else {
tmp = strtol(begin, NULL, 10);
return HOUR(tmp / 100) + tmp % 100;
}
case 5:
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
}
return 0;
while (isdigit(**ptr) || **ptr == ':') {
++*ptr;
}
end = *ptr;
switch (end - begin) {
case 1: /* H */
case 2: /* HH */
return HOUR(strtol(begin, NULL, 10));
break;
case 3: /* H:M */
case 4: /* H:MM, HH:M, HHMM */
if (begin[1] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10);
return tmp;
} else if (begin[2] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
} else {
tmp = strtol(begin, NULL, 10);
return HOUR(tmp / 100) + tmp % 100;
}
case 5: /* HH:MM */
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
}
return 0;
}
+2 -2
View File
@@ -38,8 +38,8 @@
# define timelib_free free
#endif
#define TIMELIB_VERSION 201502
#define TIMELIB_ASCII_VERSION "2015.02"
#define TIMELIB_VERSION 201602
#define TIMELIB_ASCII_VERSION "2016.02"
#define TIMELIB_NONE 0x00
#define TIMELIB_OVERRIDE_TIME 0x01
Loaded 100 of 444 files, more files were not shown because too many files have changed in this diff. Show more