mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
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:
parent
aa8dfa0b74
commit
d1d0d0b71a
1
NEWS
1
NEWS
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user