mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Fix bug #69545 - avoid overflow when reading list
This commit is contained in:
parent
95fa727992
commit
ac28329354
@ -1615,8 +1615,8 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
databuf_t *data = NULL;
|
||||
char *ptr;
|
||||
int ch, lastch;
|
||||
int size, rcvd;
|
||||
int lines;
|
||||
size_t size, rcvd;
|
||||
size_t lines;
|
||||
char **ret = NULL;
|
||||
char **entry;
|
||||
char *text;
|
||||
@ -1658,7 +1658,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
lines = 0;
|
||||
lastch = 0;
|
||||
while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) {
|
||||
if (rcvd == -1) {
|
||||
if (rcvd == -1 || rcvd > ((size_t)(-1))-size) {
|
||||
goto bail;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user