diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-23 15:17:31 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-23 15:57:24 +0200 |
commit | e94126aac74a80749c7bcf00f5faa9ad9542c94b (patch) | |
tree | 9e823480cbabfbf653cf712c9e1edf90978a118a | |
parent | 91982bad639d49dbe5ab5d80721df0b030450aac (diff) | |
download | php-git-e94126aac74a80749c7bcf00f5faa9ad9542c94b.tar.gz |
Fix #55857: ftp_size on large files
`atol()` returns a `long` which is not the same as `zend_long` on
LLP64; we use `ZEND_ATOL()` instead.
There is no need for a new test case, since filesize_large.phpt already
tests for that behavior; unfortunately, the FTP test suite relies on
`pcntl_fork()` and therefore cannot be run on Windows.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | ext/ftp/ftp.c | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 7.3.21 +- FTP: + . Fixed bug #55857 (ftp_size on large files). (cmb) + ?? ??? ????, PHP 7.3.20 - Core: diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 27def54672..0f6b711bd3 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -1133,6 +1133,8 @@ bail: zend_long ftp_size(ftpbuf_t *ftp, const char *path, const size_t path_len) { + zend_long res; + if (ftp == NULL) { return -1; } @@ -1145,7 +1147,8 @@ ftp_size(ftpbuf_t *ftp, const char *path, const size_t path_len) if (!ftp_getresp(ftp) || ftp->resp != 213) { return -1; } - return atol(ftp->inbuf); + ZEND_ATOL(res, ftp->inbuf); + return res; } /* }}} */ |