Commit Graph

217 Commits

Author SHA1 Message Date
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Joe Watkins
ed1f64e083
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix bug #74780 parse_url() borken when query string contains colon
2017-06-22 11:52:39 +01:00
jhdxr
db287b2303
fix bug #74780 parse_url() borken when query string contains colon 2017-06-22 11:52:06 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Nikita Popov
1c733a345f Merge branch 'PHP-7.0' into PHP-7.1 2016-11-22 19:25:53 +01:00
Nikita Popov
5b88c61580 Merge branch 'PHP-5.6' into PHP-7.0 2016-11-22 19:25:31 +01:00
Nikita Popov
2d19c92fc2 Make php_url_parse_ex() respect length argument
This should fix all out-of-bounds reads that could previously
occur if the string passed to php_url_parse_ex() is not NUL
terminated.
2016-11-22 19:24:24 +01:00
Nikita Popov
f0f68c7274 Cleanup parse_url() query/fragment handling
The query/fragment handling was pretty convoluted, with many parts
being duplicated. Simplify by checking for fragment, then for query,
then for path.
2016-11-22 19:24:23 +01:00
Nikita Popov
9befad6fc2 Cleanup parse_url() gotos
Simplify some unnecessarily complicated code. In particular the
length updates are unnecessary (length is only used at the very
start) and we're goto'ing around a bit too much.
2016-11-22 19:24:21 +01:00
Nikita Popov
9c1c8be7a2 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-08 01:10:37 +02:00
Nikita Popov
159de7723e Merge branch 'PHP-5.6' into PHP-7.0 2016-10-08 01:06:02 +02:00
Nikita Popov
b061fa909d Fix bug #73192 2016-10-08 01:04:22 +02:00
Nikita Popov
1c468ee044 Revert "Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986"
This reverts commit 085dfca02b.
2016-10-08 00:43:17 +02:00
Stanislav Malyshev
56e19b7c75 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test
  Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986
  Apparently negative wordwrap is a thing and should work as length = 0.
2016-10-04 21:56:28 -07:00
Ilia Alshanetsky
085dfca02b Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986 2016-10-04 21:20:31 -07:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Stanislav Malyshev
40bd921cea Fix TSRM build 2016-08-16 22:55:43 -07:00
Stanislav Malyshev
b9e81e5844 Fixed bug #72849 - integer overflow in urlencode 2016-08-16 22:55:42 -07:00
Julien Pauli
e2add3ed87 Fixed parse_url() for better compliance with RFC3986 2016-06-22 14:05:25 +02: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
88746d60ab Fix bug #72400 and #72403 - prevent signed int overflows for string lengths 2016-06-15 21:51:28 -07:00
Anatol Belski
d1ac9edc50 Merge branch 'PHP-7.0'
* PHP-7.0:
  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:27:39 +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
Stanislav Malyshev
67fbb06311 Merge branch 'PHP-5.5' into PHP-7.0.5
* PHP-5.5:
  Fixed bug #71704 php_snmp_error() Format String Vulnerability
  Fixed bug #71906: AddressSanitizer: negative-size-param (-1) in mbfl_strcut
  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/phar_object.c
	ext/phar/tests/badparameters.phpt
	ext/phar/tests/create_path_error.phpt
	ext/phar/tests/pharfileinfo_construct.phpt
	ext/snmp/snmp.c
	ext/standard/url.c
	main/php_version.h
2016-03-28 23:55:05 -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
Stanislav Malyshev
95433e8e33 Fix bug #71798 - Integer Overflow in php_raw_url_encode 2016-03-27 14:22:19 -07:00
Stanislav Malyshev
85ccebc1c2 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fix bug #71750: use zend_string_safe_alloc for calculated allocations
  Fix bug #71735: Double-free in SplDoublyLinkedList::offsetSet
2016-03-20 22:51:12 -07:00
Stanislav Malyshev
c4517b2a5e Fix bug #71750: use zend_string_safe_alloc for calculated allocations 2016-03-20 22:39:17 -07:00
Lior Kaplan
3d5438bf7b Merge branch 'PHP-7.0'
* PHP-7.0:
  Update header to PHP Version 7
  Happy new year (Update copyright to 2016)
  Happy new year (Update copyright to 2016)
2016-01-01 20:04:31 +02:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Ilia Alshanetsky
f705063e23 Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986 2015-12-22 18:12:56 +01:00
Ferenc Kovacs
1e66f1b9ad Merge branch 'pr-1204'
* pr-1204:
  no need for default value
  allow passing null as the third param
  Implemented FR #55716 - Add an option to pass a custom stream context
2015-10-08 10:23:24 +02:00
Stanislav Malyshev
899753f240 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #70480 (php_url_parse_ex() buffer overflow read)
2015-09-28 13:08:44 -07:00
Stanislav Malyshev
e2aa80019c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #70480 (php_url_parse_ex() buffer overflow read)
2015-09-28 13:05:02 -07:00
Stanislav Malyshev
629e4da7cc Fix bug #70480 (php_url_parse_ex() buffer overflow read) 2015-09-28 11:31:14 -07:00
Dmitry Stogov
ad4fa8f758 Fixed incorrect usage of HASH_OF() macro. Replaced HASH_OF() with more appropriate Z_ARRVAL_P() or Z_OBJPROP_P(). 2015-09-24 22:39:59 +03:00
Christoph M. Becker
e49922d3f8 Fix #69976: Unable to parse "all" urls with colon char
If a colon occurs in a query string or fragment of a partial URL without
scheme, parse_url() tries to regard it as port separator. If up to 5 digits
follow and then a slash or the end of the string, parse_url() fails.

We're fixing this by checking whether the colon is part of the query string or
the fragment, under the assumption that question marks and hash signs are only
allowed as separators of query string and fragments, respectively, what is
guarenteed for URIs (RFC 3986), but not necessarily for URLs (RFC 1738) where
question marks are allowed for usernames and passwords.

Anyhow, this constitutes a minor BC, so the fix is applied to master only.
2015-07-01 23:48:16 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
olshevskiy87
8bdec7a248 fix typos
Signed-off-by: olshevskiy87 <olshevskiy87@bk.ru>
2015-05-13 22:28:35 +04:00
Ferenc Kovacs
0a10440cad no need for default value 2015-03-30 18:34:02 +02:00
Ferenc Kovacs
b9b0d3db39 allow passing null as the third param 2015-03-30 11:22:31 +02:00
Ferenc Kovacs
fd01b47b8e Implemented FR #55716 - Add an option to pass a custom stream context 2015-03-30 01:09:07 +02:00
Kalle Sommer Nielsen
6a8ab3d7c6 Fix additional NULL byte added to string keys in get_header(), spotted by Ferenc 2015-03-30 00:52:28 +02:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Tjerk Meesters
1236a30746 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #68917 (parse_url fails on some partial urls)
  Update test to run locally instead of remotely
2015-03-06 20:59:52 +08:00
Tjerk Meesters
d7fb52ea20 Fixed bug #68917 (parse_url fails on some partial urls) 2015-03-06 20:51:22 +08:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00