Merge branch '4560_extfs_open_deleted_archive'

* 4560_extfs_open_deleted_archive:
  Ticket #4560: extfs: fix segfault om enter to deleted archive.
This commit is contained in:
Andrew Borodin 2024-07-11 21:07:32 +03:00
commit b68243df1e
1 changed files with 11 additions and 3 deletions

View File

@ -531,7 +531,10 @@ extfs_open_archive (int fstype, const char *name, struct extfs_super_t **pparc,
if (info->need_archive)
{
if (mc_stat (name_vpath, &mystat) == -1)
{
mc_propagate_error (error, 0, "%s", unix_error_string (errno));
goto ret;
}
if (!vfs_file_is_local (name_vpath))
{
@ -737,9 +740,14 @@ extfs_open_and_read_archive (int fstype, const char *name, struct extfs_super_t
const extfs_plugin_info_t *info;
info = &g_array_index (extfs_plugins, extfs_plugin_info_t, fstype);
message (D_ERROR, MSG_ERROR, _("Cannot open %s archive\n%s:\n%s"), info->prefix, name,
error->message);
g_error_free (error);
if (error == NULL)
message (D_ERROR, MSG_ERROR, _("Cannot open %s archive\n%s"), info->prefix, name);
else
{
message (D_ERROR, MSG_ERROR, _("Cannot open %s archive\n%s:\n%s"), info->prefix, name,
error->message);
g_error_free (error);
}
}
else
{