mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
some broken ftp servers return 32bit port numbers.
This commit is contained in:
parent
29be52fbfb
commit
87c0577a0c
1 changed files with 3 additions and 3 deletions
|
@ -352,7 +352,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
|
||||||
hoststart = ip;
|
hoststart = ip;
|
||||||
|
|
||||||
/* pull out the MSB of the port */
|
/* pull out the MSB of the port */
|
||||||
portno = (unsigned short) strtol(tpath, &ttpath, 10) * 256;
|
portno = (unsigned short) strtoul(tpath, &ttpath, 10) * 256;
|
||||||
if (ttpath == NULL) {
|
if (ttpath == NULL) {
|
||||||
/* didn't get correct response from PASV */
|
/* didn't get correct response from PASV */
|
||||||
goto errexit;
|
goto errexit;
|
||||||
|
@ -362,7 +362,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
|
||||||
goto errexit;
|
goto errexit;
|
||||||
tpath++;
|
tpath++;
|
||||||
/* pull out the LSB of the port */
|
/* pull out the LSB of the port */
|
||||||
portno += (unsigned short) strtol(tpath, &ttpath, 10);
|
portno += (unsigned short) strtoul(tpath, &ttpath, 10);
|
||||||
} else {
|
} else {
|
||||||
/* parse epsv command (|||6446|) */
|
/* parse epsv command (|||6446|) */
|
||||||
for (i = 0, tpath = tmp_line + 4; *tpath; tpath++) {
|
for (i = 0, tpath = tmp_line + 4; *tpath; tpath++) {
|
||||||
|
@ -375,7 +375,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
|
||||||
if (i < 3)
|
if (i < 3)
|
||||||
goto errexit;
|
goto errexit;
|
||||||
/* pull out the port */
|
/* pull out the port */
|
||||||
portno = (unsigned short) strtol(tpath + 1, &ttpath, 10);
|
portno = (unsigned short) strtoul(tpath + 1, &ttpath, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ttpath == NULL) {
|
if (ttpath == NULL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue