mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
bab0b99f37
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. |
||
---|---|---|
.. | ||
streams | ||
alloca.c | ||
build-defs.h.in | ||
fastcgi.c | ||
fastcgi.h | ||
fopen_wrappers.c | ||
fopen_wrappers.h | ||
getopt.c | ||
http_status_codes.h | ||
internal_functions_nw.c | ||
internal_functions_win32.c | ||
internal_functions.c.in | ||
main.c | ||
mergesort.c | ||
network.c | ||
output.c | ||
php_compat.h | ||
php_content_types.c | ||
php_content_types.h | ||
php_getopt.h | ||
php_globals.h | ||
php_ini.c | ||
php_ini.h | ||
php_main.h | ||
php_memory_streams.h | ||
php_network.h | ||
php_open_temporary_file.c | ||
php_open_temporary_file.h | ||
php_output.h | ||
php_reentrancy.h | ||
php_scandir.c | ||
php_scandir.h | ||
php_sprintf.c | ||
php_stdint.h | ||
php_streams.h | ||
php_syslog.h | ||
php_ticks.c | ||
php_ticks.h | ||
php_variables.c | ||
php_variables.h | ||
php_version.h | ||
php.h | ||
reentrancy.c | ||
rfc1867.c | ||
rfc1867.h | ||
SAPI.c | ||
SAPI.h | ||
snprintf.c | ||
snprintf.h | ||
spprintf.c | ||
spprintf.h | ||
strlcat.c | ||
strlcpy.c | ||
win95nt.h |