Commit Graph

10043 Commits

Author SHA1 Message Date
Lauri Kenttä
e616bc8694 Fix bug #55451
Make substr_compare ignore the length if it's NULL. This allows to
use the last parameter (case_insensitivity) with the default length.
2016-08-07 18:48:36 +02:00
Nikita Popov
56d7e98ddf Merge branch 'PHP-5.6' into PHP-7.0 2016-08-07 18:38:28 +02:00
Nikita Popov
40d237df1f Fix stream_socket_enable_crypto() test
The whole test doesn't make any sense at all, but this only fixes
the additional warnings you get when linked against openssl w/o
SSL3.
2016-08-07 18:37:38 +02:00
Nikita Popov
a2a2ea18fe Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-05 23:09:30 +02:00
Ville Hukkamaki
65056e9d6c Fix #72764
Negotiate data channel encryption after NLST command.
This is to prevent issues with IIS and ProFTPD.
2016-08-05 22:56:54 +02:00
Christoph M. Becker
a8515a339d Fix broken skip marker in test case 2016-08-04 12:06:07 +02:00
Stanislav Malyshev
b57474f23e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72716 - initialize buffer before read

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-03 23:00:32 -07:00
Stanislav Malyshev
4f861b6071 Fix bug #72716 - initialize buffer before read 2016-08-03 22:59:42 -07:00
Nikita Popov
8a442a33c3 Fix ref handling in array_merge/replace_recursive()
As usual, if the reference has rc=1 it really isn't a reference.
2016-07-29 19:07:04 +02:00
Anatol Belski
c52322707e Fixed bug #72683 getmxrr broken 2016-07-27 20:48:45 +02:00
Nikita Popov
0d2c4f822c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-27 15:58:06 +02:00
Ville Hukkamäki
cce457c68c Fix bug #72667
Open data stream after receiving PASV reply, before sending the
main request.

Included test cases for opendir() with ftp:// and ftps:// wrappers.
Test cases re-use ext/ftp/tests/server.inc

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-27 15:55:47 +02:00
Nikita Popov
f12fd5c2d3 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-23 13:29:57 +02:00
vhuk
65abdb556d Fix for bug #54431 2016-07-23 13:28:42 +02:00
Christoph M. Becker
4472f9e822 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 18:39:27 +02:00
Christoph M. Becker
f2c2a4be9e Fix #72330: CSV fields incorrectly split if escape char followed by UTF chars
We must not forget to properly reset the state for multibyte characters
following an escape character.
2016-07-21 18:37:24 +02:00
Xinchen Hui
e4af29b0b7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed arginfo
2016-07-20 18:07:18 +08:00
Xinchen Hui
9ebc96116b Fixed arginfo 2016-07-20 18:07:02 +08:00
Xinchen Hui
3c3b8c8365 Fixed bug #72622 (array_walk + array_replace_recursive create references from nothing) 2016-07-20 16:12:37 +08:00
Stanislav Malyshev
b00f8f2a5b 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
2016-07-19 01:39:28 -07:00
Stanislav Malyshev
4d0565b5ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  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
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	ext/bz2/bz2.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 00:53:08 -07:00
Stanislav Malyshev
08ac37bd2a Merge branch 'PHP-5.5.38' into PHP-5.5
* PHP-5.5.38:
  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
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434
2016-07-18 23:32:38 -07:00
Nikita Popov
a50a5c1bf1 Fix is_callable() on abstract method via object 2016-07-14 21:41:41 +02:00
Xinchen Hui
f71fcf8bdd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport to 5.6 (we should not unset the default value)

Conflicts:
	Zend/zend_exceptions.c
	ext/standard/tests/serialize/bug69152.phpt
2016-07-12 12:18:09 +08:00
Xinchen Hui
7903276f4c backport to 5.6 (we should not unset the default value) 2016-07-12 12:14:45 +08:00
Stanislav Malyshev
98b9dfaec9 Fix for HTTP_PROXY issue.
The following changes are made:
- _SERVER/_ENV only has HTTP_PROXY if the local environment has it,
  and only one from the environment.
- getenv('HTTP_PROXY') only returns one from the local environment
- getenv has optional second parameter, telling it to only consider
  local environment
2016-07-10 16:21:11 -07:00
Julien Pauli
87fe485c35 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Backported bug #71144 (Segmentation fault when using cURL with ZTS)
  fix bug #72024 (microtime() leaks memory)

Conflicts:
	ext/curl/interface.c
2016-07-08 15:05:13 +02:00
Michael Maroszek
0be13d2dc2 fix bug #72024 (microtime() leaks memory) 2016-07-08 14:36:44 +02:00
Lauri Kenttä
3104759915 base64_decode: fix bug #72264 ('VV= =' shouldn't fail in strict mode) 2016-07-07 01:27:23 +02:00
Lauri Kenttä
0259459486 base64_decode: remove redundant code
case 1 is already handled in the first lines of the for loop;
it would only be entered in the invalid case where the string
continues past the defined length (ch != 0 but length-- == 0).

case 2 and case 3 are redundant, since k >= j and later the
string is truncated to j characters anyway.
2016-07-07 01:27:23 +02:00
Lauri Kenttä
c1ac081bf1 base64_decode: fix bug #72263 (skips char after padding) 2016-07-07 01:27:23 +02:00
Lauri Kenttä
b9c9be13cc base64_decode: fix bug #72152 (fail on NUL bytes in strict mode)
This added check is actually for NOT failing in NON-strict mode.
The ch == -2 check later causes the desired failure in strict mode.
2016-07-07 01:27:23 +02:00
Lauri Kenttä
ef6f163161 base64_decode: remove redundant check
If length == 0 || *current != '=' is false, the for loop will always
end up in this same point, until the if statement becomes true.
Thus, the if statement is not needed.
2016-07-07 01:27:23 +02:00
Lauri Kenttä
c65de8ac13 base64_decode: reorder to fix out of bounds read 2016-07-07 01:27:22 +02:00
Anatol Belski
4576c41291 fix possible optimization bug 2016-07-05 14:57:16 +02:00
Stanislav Malyshev
e1ba58f068 Fix bug #70480 (php_url_parse_ex() buffer overflow read)
(cherry picked from commit 629e4da7cc)
2016-07-05 10:59:02 +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
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
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
ed10168b30 fix two remaining tests 2016-06-21 17:24:08 +02: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
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
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
Stanislav Malyshev
88746d60ab Fix bug #72400 and #72403 - prevent signed int overflows for string lengths 2016-06-15 21:51:28 -07:00