Merge branch '2535_ftp_segfault'

* 2535_ftp_segfault:
  Check whether VFS provides an open_archive() method.
  Ticket #2535: segfault in FTP VFS
This commit is contained in:
Andrew Borodin 2011-04-12 15:57:50 +04:00
commit 2758599bc2
1 changed files with 3 additions and 1 deletions

View File

@ -1067,7 +1067,8 @@ vfs_s_get_path_mangle (struct vfs_class *me, char *inname, struct vfs_s_super **
ERRNOR (EIO, NULL);
super = vfs_s_new_super (me);
result = MEDATA->open_archive (me, super, archive_name, op);
if (MEDATA->open_archive != NULL)
result = MEDATA->open_archive (me, super, archive_name, op);
if (result == -1)
{
vfs_s_free_super (me, super);
@ -1198,6 +1199,7 @@ vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode)
fh->handle = -1;
fh->changed = was_changed;
fh->linear = 0;
fh->data = NULL;
if (IS_LINEAR (flags))
{