1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00
Commit Graph

265 Commits

Author SHA1 Message Date
fancyweb e691a98c1f Fix #76342: file_get_contents waits twice specified timeout 2019-09-17 15:42:29 +02:00
Peter Kokot 902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Stanislav Malyshev ab9f9b5d3b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #75981: prevent reading beyond buffer start
2018-02-26 22:26:55 -08:00
Stanislav Malyshev a6f7760d57 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #75981: prevent reading beyond buffer start
2018-02-26 22:26:50 -08:00
Stanislav Malyshev dde7a05978 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #75981: prevent reading beyond buffer start
2018-02-26 22:26:26 -08:00
Stanislav Malyshev 523f230c83 Fix bug #75981: prevent reading beyond buffer start 2018-02-26 22:25:51 -08:00
Xinchen Hui 7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Nikita Popov 31d9287d2b Merge branch 'PHP-7.1' into PHP-7.2 2017-11-17 23:22:07 +01:00
Nikita Popov 092d0922ea Merge branch 'PHP-7.0' into PHP-7.1 2017-11-17 23:21:48 +01:00
Nikita Popov 0e097f2c96 Fixed bug #75535
The sizeof()s for Content-Length and Transfer-Encoding were missing
the trailing ":". Apart from being generally wrong, this no longer
verified that the header actually contains a colon, leading to the
null http_header_value being used.

Additionally, in the interest of being defensive, also make sure
that http_header_value is non-null by setting it to the end of
the header line (effectively an empty string) if there is no colon.
If the following conditions are correct, this value is not going
to be used though.
2017-11-17 23:18:05 +01:00
Nikita Popov 3a4db74ee4 Create $http_response_header even if not used
Extensions are relying on it.
2017-09-26 09:20:43 +02:00
Nikita Popov 5eeb414770 Write $http_response_header to local var at end
Rather than trying to modify it mid-request. The protection against
tampering that was used (addref) violates COW because an rc>1 array
is being modified.

Test bug69337.phpt changed because it was testing tampering with
$http_response_header while the HTTP request is being executed.
This simply no longer matters, so behavior is the same as if no
tampering occurred.
2017-01-13 23:27:07 +01:00
Nikita Popov 72038b6c38 Merge branch 'PHP-7.1' 2017-01-08 00:02:42 +01:00
Nikita Popov ac46909162 Merge branch 'PHP-7.0' into PHP-7.1 2017-01-08 00:02:33 +01:00
Nikita Popov ec1b7b933d Fix OOB read introduced by previous commit
Ooops...
2017-01-08 00:01:05 +01:00
Nikita Popov 49c48e3f3a Merge branch 'PHP-7.1' 2017-01-07 23:56:00 +01:00
Nikita Popov d48ff0f3f5 Merge branch 'PHP-7.0' into PHP-7.1 2017-01-07 23:55:48 +01:00
Rowan Collins 5146d9f8ac http_fopen_wrapper.c - Handle HTTP headers with varying white space
The stream handler assumed all HTTP headers contained exactly one space,
but the standard says there may be zero or more. Should fix Bug #47021,
and any other edge cases caused by a web server sending unusual spacing,
e.g. the MIME type discovered from Content-Type: can no longer contain
leading whitespace.

We strip trailing whitespace from the headers added into
$http_response_header as well.
2017-01-07 23:54:57 +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
Sammy Kaye Powers 9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Julien Pauli 4b2cbc3f2f Improvement for bug73297 2016-11-17 11:51:53 +01:00
Rowan Collins 94374c51e7 http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses 2016-11-17 11:51:53 +01:00
Julien Pauli 0f9225f893 Improvement for bug73297 2016-11-17 11:51:30 +01:00
Rowan Collins 417162a9ba http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses 2016-11-17 11:51:29 +01:00
Julien Pauli 607049f2d1 Improvement for bug73297 2016-11-17 11:50:36 +01:00
Rowan Collins f20d261acd http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses 2016-11-17 11:50:36 +01:00
Julien Pauli 49030f2a25 Improvement for bug73297 2016-11-17 11:33:36 +01:00
Rowan Collins aec1a5eccc http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses 2016-11-17 11:04:56 +01:00
Kalle Sommer Nielsen 2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Nikita Popov 3823bfc6f2 Avoid use of scratch space in HTTP fopen wrapper
Instead directly write into req_buf smart_str.
2016-08-07 17:43:06 +02:00
Ville Hukkamäki 318d3b3a3f Implement request #27814
Construct HTTP request headers into smart_str and send whole
request in one go.
2016-08-04 14:20:36 +02:00
Dmitry Stogov adc95c5114 Fixed compilation warnings 2016-06-23 12:47:06 +03:00
Dmitry Stogov 1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Xinchen Hui c3cf6f2a68 emalloc never returns NULL (partially fix for #71753) 2016-03-10 15:15:26 +08: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
Dmitry Stogov c67fc6bb09 Fixed memory leak in php_stream_context_set_option() 2015-10-29 20:06:55 +03:00
Bob Weinand 3d05785054 Merge remote-tracking branch 'origin/PHP-5.6' 2015-09-04 16:35:15 +02:00
Niklas Keller 4b1dff6f43 Fix #70361: HTTP stream wrapper doesn't close keep-alive connections 2015-09-04 16:29:35 +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
Dmitry Stogov 4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Stanislav Malyshev 494870fded Restore fix for bug #69337 2015-04-18 15:48:09 -07:00
Dmitry Stogov 28011fd14f Fixed recently introduced memory leak 2015-04-14 14:46:26 +03:00
Stanislav Malyshev b3709bfc52 Merge branch 'PHP-5.6'
* PHP-5.6: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	Zend/zend_exceptions.c
	ext/curl/interface.c
	ext/dom/document.c
	ext/fileinfo/libmagic/softmagic.c
	ext/gd/gd.c
	ext/hash/hash.c
	ext/pgsql/pgsql.c
	ext/phar/phar.c
	ext/phar/phar_internal.h
	ext/standard/http_fopen_wrapper.c
	ext/standard/link.c
	ext/standard/streamsfuncs.c
	ext/xmlwriter/php_xmlwriter.c
	ext/zlib/zlib.c
2015-04-14 01:28:06 -07:00
Stanislav Malyshev 5776fceb16 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
2015-04-14 01:05:01 -07:00
Stanislav Malyshev ba15e8dfd0 Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  fix memory leak & add test
  Fix tests
2015-04-12 23:49:16 -07:00
Stanislav Malyshev 45facd15fb fix memory leak & add test 2015-04-12 22:38:34 -07:00
Stanislav Malyshev ed7d4977bb Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
2015-04-12 20:13:00 -07:00