diff options
| author | Sara Golemon <pollita@php.net> | 2003-09-09 21:15:20 +0000 |
|---|---|---|
| committer | Sara Golemon <pollita@php.net> | 2003-09-09 21:15:20 +0000 |
| commit | 3f585ac9238ebdce0198e447f6ce8399d247df02 (patch) | |
| tree | ae2695578ccefb46152c11b2d2f4a15c9bce0b16 /ext/ftp | |
| parent | f7972bc8be9bfa21831955c3c77b93fc4f956e79 (diff) | |
| download | php-git-3f585ac9238ebdce0198e447f6ce8399d247df02.tar.gz | |
MFH(r-1.91) Fix Bug #25294 LIST/NLST can cause segfault because ftp->data not cleaned properly
Diffstat (limited to 'ext/ftp')
| -rw-r--r-- | ext/ftp/ftp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 1d20ec2fc3..01710ec656 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -421,9 +421,10 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir) { if (ftp == NULL) return 0; - if (ftp->pwd) + if (ftp->pwd) { efree(ftp->pwd); - ftp->pwd = NULL; + ftp->pwd = NULL; + } if (!ftp_putcmd(ftp, "CWD", dir)) return 0; @@ -442,9 +443,10 @@ ftp_cdup(ftpbuf_t *ftp) if (ftp == NULL) return 0; - if (ftp->pwd) + if (ftp->pwd) { efree(ftp->pwd); - ftp->pwd = NULL; + ftp->pwd = NULL; + } if (!ftp_putcmd(ftp, "CDUP", NULL)) return 0; @@ -1535,8 +1537,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) return ret; bail: - if (data) - ftp->data = data_close(ftp, data); + ftp->data = data_close(ftp, data); fclose(tmpfp); if (ret) efree(ret); |
