mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Ticket #2775: segfault after open incorrect archive
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
47096e5c8e
commit
764cdf2497
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user