From: Moriyoshi Koizumi Date: Mon, 19 May 2003 13:27:05 +0000 (+0000) Subject: MFH(r-1.86): fixed bug #23683 X-Git-Tag: BEFORE_FD_REVERT~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52c6a66274f63de2fb423b881b4d58ca393df39e;p=php MFH(r-1.86): fixed bug #23683 --- diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 646e99901c..34afd72e73 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -188,9 +188,11 @@ ftp_gc(ftpbuf_t *ftp) if (ftp->pwd) { efree(ftp->pwd); + ftp->pwd = NULL; } if (ftp->syst) { efree(ftp->syst); + ftp->syst = NULL; } } /* }}} */ @@ -210,6 +212,7 @@ ftp_quit(ftpbuf_t *ftp) if (ftp->pwd) { efree(ftp->pwd); + ftp->pwd = NULL; } return 1; @@ -389,9 +392,7 @@ ftp_pwd(ftpbuf_t *ftp) return NULL; if ((end = strrchr(++pwd, '"')) == NULL) return NULL; - *end = 0; - ftp->pwd = estrdup(pwd); - *end = '"'; + ftp->pwd = estrndup(pwd, end - pwd); return ftp->pwd; }