mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Ticket #1725: Do not abort on broken .cpio file
For some reason, mc aborts if .cpio magic as wrong. This trivial patch makes mc handle it gracefully. Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
d06bab4de3
commit
710d88cf3c
@ -290,9 +290,9 @@ static ssize_t cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *supe
|
||||
for(i = 0; i < (HEAD_LENGTH >> 1); i++)
|
||||
u.shorts[i] = GUINT16_SWAP_LE_BE_CONSTANT(u.shorts[i]);
|
||||
}
|
||||
g_assert(u.buf.c_magic == 070707);
|
||||
|
||||
if (u.buf.c_namesize == 0 || u.buf.c_namesize > MC_MAXPATHLEN) {
|
||||
if (u.buf.c_magic != 070707 ||
|
||||
u.buf.c_namesize == 0 || u.buf.c_namesize > MC_MAXPATHLEN) {
|
||||
message (D_ERROR, MSG_ERROR, _("Corrupted cpio header encountered in\n%s"),
|
||||
super->name);
|
||||
return STATUS_FAIL;
|
||||
|
Loading…
Reference in New Issue
Block a user