mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Ticket #4422: extfs: segfault if archive contains file(s) in the parent directory.
zip archive can contain files outside archive root: $ unzip -l tmp.zip Archive: tmp.zip Length Date Time Name --------- ---------- ----- ---- 0 2023-01-04 19:43 a 0 2023-01-04 19:43 b 0 2023-01-04 19:43 ../c 0 2023-01-04 19:43 ../../d --------- ------- 0 4 files Enter into such archive leads to a segfault. (extfs_find_entry_int): fix possible NULL dereference. The result of this fix is an impossibility to enter into such archive. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
ba64c89b97
commit
69ed5696f2
@ -254,7 +254,7 @@ extfs_find_entry_int (struct vfs_s_inode *dir, const char *name, GSList * list,
|
||||
*q = '\0';
|
||||
|
||||
if (DIR_IS_DOTDOT (p))
|
||||
pent = pent->dir->ent;
|
||||
pent = pent->dir != NULL ? pent->dir->ent : NULL;
|
||||
else
|
||||
{
|
||||
GList *pl;
|
||||
|
Loading…
Reference in New Issue
Block a user