Commit Graph

132 Commits

Author SHA1 Message Date
Anatol Belski
2111de0dd7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Revert "Detect invalid port in xp_socket parse ip address"
  Revert "Follow up patch regarding bug #74216, see bug #74429"
2017-04-27 11:13:00 +02:00
Anatol Belski
392bcba58d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "Detect invalid port in xp_socket parse ip address"
  Revert "Follow up patch regarding bug #74216, see bug #74429"
2017-04-27 11:11:41 +02:00
Anatol Belski
09ef61e3ca Revert "Detect invalid port in xp_socket parse ip address"
This reverts commit bab0b99f37.
2017-04-27 02:49:12 +02:00
Anatol Belski
bf3e2dce7b Revert "Follow up patch regarding bug #74216, see bug #74429"
This reverts commit cda7dcf4ca.
2017-04-27 02:49:01 +02:00
Anatol Belski
bbf0a9d8a7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Follow up patch regarding bug #74216, see bug #74429
2017-04-25 13:00:10 +02:00
Anatol Belski
faf19a7756 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Follow up patch regarding bug #74216, see bug #74429
2017-04-25 12:59:22 +02:00
Sara Golemon
cda7dcf4ca Follow up patch regarding bug #74216, see bug #74429
While the case in bug #74429 is not documented and is only worky due to
an implementation bug, the strength seems to breach some real world
apps. Given this patch doesn't impact the initial security fix for
bug #74216, it is reasonable to let the apps keep working. As mentioned
in the ticket, this behavior is a subject to change in future versions
and should not be abused.
2017-04-25 12:52:48 +02:00
Sara Golemon
2ba2b768cc Merge branch 'PHP-7.1'
* PHP-7.1:
  Detect invalid port in xp_socket parse ip address
2017-03-07 12:11:31 -08:00
Sara Golemon
1a19b97ac3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Detect invalid port in xp_socket parse ip address
2017-03-07 12:11:22 -08:00
Sara Golemon
bab0b99f37 Detect invalid port in xp_socket parse ip address
For historical reasons, fsockopen() accepts the port and hostname
separately: fsockopen('127.0.0.1', 80)

However, with the introdcution of stream transports in PHP 4.3,
it became possible to include the port in the hostname specifier:

fsockopen('127.0.0.1:80')
Or more formally: fsockopen('tcp://127.0.0.1:80')

Confusing results when these two forms are combined, however.
fsockopen('127.0.0.1:80', 443) results in fsockopen() attempting
to connect to '127.0.0.1:80:443' which any reasonable stack would
consider invalid.

Unfortunately, PHP parses the address looking for the first colon
(with special handling for IPv6, don't worry) and calls atoi()
from there.  atoi() in turn, simply stops parsing at the first
non-numeric character and returns the value so far.

The end result is that the explicitly supplied port is treated
as ignored garbage, rather than producing an error.

This diff replaces atoi() with strtol() and inspects the
stop character.  If additional "garbage" of any kind is found,
it fails and returns an error.
2017-03-07 12:10:53 -08:00
Anatol Belski
e7b4ee3165 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string
2017-02-15 14:51:38 +01:00
Anatol Belski
2a61e5495a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string
2017-02-15 14:49:58 +01:00
Anatol Belski
89a5bd6750 Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string 2017-02-15 11:22:47 +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
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
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
3e1329c184 Merge branch 'PHP-7.0' 2016-06-18 21:34:33 -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
Joe Watkins
66fc5a3436 Implement #51879 stream context socket option tcp_nodelay 2016-04-29 12:11:58 +01: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
Bob Weinand
855bb36fd0 Add support for IPV6_V6ONLY on sockets 2015-11-06 21:45:31 +01:00
Anatol Belski
797e30f4fc Fixed bug #70198 Checking liveness does not work as expected 2015-08-11 17:36:10 +02:00
Xinchen Hui
9834cd9339 Revert "Revert "suggest parentheses around ‘&&’ within ‘||’""
This reverts commit ec1e8929c4.
2015-08-11 22:34:39 +08:00
Xinchen Hui
ec1e8929c4 Revert "suggest parentheses around ‘&&’ within ‘||’"
This reverts commit 4f2c0e0451.
2015-08-11 22:14:37 +08:00
Xinchen Hui
4f2c0e0451 suggest parentheses around ‘&&’ within ‘||’ 2015-08-11 21:43:38 +08:00
Anatol Belski
7eb6bd1311 add EAGAIN checks
EAGAIN and EWOULDBLOCK should be checked together and don't necessary,
have same value. So checking both is better for portability.
2015-08-11 15:17:25 +02:00
Anatol Belski
24f0fe6b1f Fixed bug #70198 Checking liveness does not work as expected 2015-08-11 14:40:34 +02:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
e112f6a04e second shot on removing TSRMLS_* 2014-12-14 14:07:59 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
e1d0ca7cae fix unused var warning 2014-11-14 17:39:37 +01:00
Anatol Belski
0f5858e3a3 fix datatype mismatch 2014-10-27 17:31:38 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
455741fce3 master renames phase 4 2014-08-25 20:57:25 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Dmitry Stogov
5a06ac88da cleanup (use zend_string* instead of char*) 2014-08-13 14:51:48 +04:00
Dmitry Stogov
4c716e8b51 Merge branch 'master' into test
* master: (39 commits)
  Add __debugInfo() to UPGRADING.
  fix TS build
  Update NEWS
  Update NEWS
  Update NEWS
  Small tidy ups and raise visibility of GitHub PR process
  Bug #41631: Observe socket read timeouts in SSL streams
  wrap int8_t and int16_t with #ifdef to avoid possible clashes
  - Updated to version 2014.6 (2014f)
  Removed Countable::count() change info from UPGRADE.INTERNALS too
  NEWS and UPGRADING for intdiv()
  Revert "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option"
  Fixed skip case for intdiv 64-bit test
  Use callback structure
  Add EXPECTF
  Fix handling of multi-result sets with PS...used to clean not only the result set but the whole PS.
  5.5.17 now
  5.4.33-dev now
  Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option
  Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option
  ...

Conflicts:
	ext/fileinfo/libmagic/softmagic.c
	main/streams/xp_socket.c
2014-08-11 11:38:41 +04:00
Dmitry Stogov
417ed16d11 Make stream->context indirect trough zend_resource (stream->ctx->ptr).
Fixed ext/standard/tests/streams/bug61115.phpt
2014-08-07 15:55:37 +04:00
Ferenc Kovacs
791c87ae48 Revert "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option"
This reverts commit a51bf0cadf.
2014-08-06 20:33:48 +02:00
Daniel Lowrey
a51bf0cadf Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option 2014-08-05 23:13:04 -04:00
Daniel Lowrey
f6b530bd54 Merge branch 'PHP-5.6' 2014-08-05 22:58:45 -04:00
Daniel Lowrey
60552a8871 Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option 2014-08-05 22:43:12 -04:00