Commit graph

322 commits

Author SHA1 Message Date
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
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +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
Dmitry Stogov
0f06df310c Turn "php_stream_wrapper"s into constants
Keep non-constant "php_stream_wrapper"s in API functions and callbacks for compatibility.
2017-12-14 22:46:22 +03:00
Dmitry Stogov
83e495e0fd Move constants into read-only data segment 2017-12-14 22:14:36 +03:00
Nikita Popov
a8db62086e Merge branch 'PHP-7.2' 2017-11-17 23:22:12 +01: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
Anatol Belski
c7bf314b65 Fix unsigned comparison 2017-11-17 18:54:42 +01:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Nikita Popov
49d895af86 Merge branch 'PHP-7.2' 2017-09-26 09:21:16 +02: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
Xinchen Hui
513b0093c2 Refactor php_url struct to save memory dup in common cases 2017-08-06 17:48:05 +08: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