From: Moriyoshi Koizumi Date: Mon, 19 May 2003 13:26:28 +0000 (+0000) Subject: Fixed bug #23683 X-Git-Tag: RELEASE_1_0_2~742 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08bf40244031b99054cc7d27490790ca1259190e;p=php Fixed bug #23683 --- diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index fa184aa4a3..a7e76de84c 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -202,9 +202,11 @@ ftp_gc(ftpbuf_t *ftp) } if (ftp->pwd) { efree(ftp->pwd); + ftp->pwd = NULL; } if (ftp->syst) { efree(ftp->syst); + ftp->syst = NULL; } } /* }}} */ @@ -227,6 +229,7 @@ ftp_quit(ftpbuf_t *ftp) if (ftp->pwd) { efree(ftp->pwd); + ftp->pwd = NULL; } return 1; @@ -426,9 +429,7 @@ ftp_pwd(ftpbuf_t *ftp) if ((end = strrchr(++pwd, '"')) == NULL) { return NULL; } - *end = 0; - ftp->pwd = estrdup(pwd); - *end = '"'; + ftp->pwd = estrndup(pwd, end - pwd); return ftp->pwd; }