]> granicus.if.org Git - php/commitdiff
MFH(Bug 22059, ftp.c-r1.77)
authorSara Golemon <pollita@php.net>
Thu, 13 Feb 2003 19:51:02 +0000 (19:51 +0000)
committerSara Golemon <pollita@php.net>
Thu, 13 Feb 2003 19:51:02 +0000 (19:51 +0000)
NEWS
ext/ftp/ftp.c

diff --git a/NEWS b/NEWS
index cec0d3e116eeada6b2ee56f20cbccd2a611ce327..99d0ce01428708ab4bedf44a105ee6cc5fb882da 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,7 @@ PHP 4                                                                      NEWS
 - Fixed bug #22103 (Added gdImageEllipse and replaced old gdImageFilledEllipse
   with a better implementation). (Pierre)
 - Fixed bug #22088 (array_shift() left next index to be +1 too much). (Jani)
+- Fixed buf #22059 (ftp_chdir() causes segfault). (Sara)
 - Fixed bug #22048 (crash in imap_header() when the e-mail contains an 
   abnormally large number of special characters). (Ilia)
 - Fixed bug #22042 (pg_result_seek() would never seek to the 1st row in the
index 67a0ca291bc954fc46e6a38e4886a247befd7e7b..b1c905e5a10cd0753b5e72c5669445d609bc0d2b 100644 (file)
@@ -421,8 +421,8 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir)
 {
        if (ftp == NULL)
                return 0;
-
-       efree(ftp->pwd);
+       if (ftp->pwd)
+               efree(ftp->pwd);
        ftp->pwd = NULL;
 
        if (!ftp_putcmd(ftp, "CWD", dir))
@@ -442,7 +442,8 @@ ftp_cdup(ftpbuf_t *ftp)
        if (ftp == NULL)
                return 0;
 
-       efree(ftp->pwd);
+       if (ftp->pwd)
+               efree(ftp->pwd);
        ftp->pwd = NULL;
 
        if (!ftp_putcmd(ftp, "CDUP", NULL))