Ticket #2775: segfault after open incorrect archive

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2012-04-09 12:22:51 +03:00
parent 47096e5c8e
commit 764cdf2497
2 changed files with 3 additions and 1 deletions

View File

@ -257,6 +257,7 @@ cpio_open_cpio_file (struct vfs_class *me, struct vfs_s_super *super, const vfs_
message (D_ERROR, MSG_ERROR, _("Cannot open cpio archive\n%s"), s);
g_free (s);
g_free (super->name);
super->name = NULL;
return -1;
}
g_free (s);

View File

@ -325,6 +325,7 @@ tar_open_archive_int (struct vfs_class *me, const vfs_path_t * vpath, struct vfs
if (result == -1)
{
g_free (archive->name);
archive->name = NULL;
ERRNOR (ENOENT, -1);
}
}
@ -911,7 +912,7 @@ init_tarfs (void)
{
static struct vfs_s_subclass tarfs_subclass;
tarfs_subclass.flags = VFS_S_READONLY; /* FIXME: tarfs used own temp files */
tarfs_subclass.flags = VFS_S_READONLY; /* FIXME: tarfs used own temp files */
tarfs_subclass.archive_check = tar_super_check;
tarfs_subclass.archive_same = tar_super_same;
tarfs_subclass.open_archive = tar_open_archive;