Bug #22059. ftp_chdir() causes segfault. efree(ftp->pwd) was being called without knowing for certain that ftp->pwd

actually pointed anywhere.
This commit is contained in:
Sara Golemon 2003-02-13 19:48:49 +00:00
parent aa8dfa0b74
commit d1d0d0b71a
2 changed files with 5 additions and 2 deletions

1
NEWS
View File

@ -3,6 +3,7 @@ PHP 4 NEWS
? ? ??? 200?, Version 5.0.0
- Moved extensions to PECL (http://pear.php.net/): (James, Tal)
. ext/fribidi
- Fixed bug #22059 (ftp_chdir causes segfault). (Sara)
- Fixed bug #20442 (upgraded bundled expat to 1.95.5). (Ilia)
- Fixed bug #20155 (xmlrpc compile problem with ZE2). (Derick, Jan Schneider)
- Changed get_extension_funcs() to return list of the built-in Zend Engine

View File

@ -473,7 +473,8 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir)
return 0;
}
efree(ftp->pwd);
if (ftp->pwd)
efree(ftp->pwd);
if (!ftp_putcmd(ftp, "CWD", dir)) {
return 0;
@ -494,7 +495,8 @@ ftp_cdup(ftpbuf_t *ftp)
return 0;
}
efree(ftp->pwd);
if (ftp->pwd)
efree(ftp->pwd);
if (!ftp_putcmd(ftp, "CDUP", NULL)) {
return 0;