aboutsummaryrefslogtreecommitdiff
path: root/fs/squashfs/sqfs_dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/squashfs/sqfs_dir.c')
-rw-r--r--fs/squashfs/sqfs_dir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/squashfs/sqfs_dir.c b/fs/squashfs/sqfs_dir.c
index 5f7660aeae8..00d2891e7da 100644
--- a/fs/squashfs/sqfs_dir.c
+++ b/fs/squashfs/sqfs_dir.c
@@ -53,6 +53,9 @@ int sqfs_dir_offset(void *dir_i, u32 *m_list, int m_count)
return -EINVAL;
}
+ if (offset < 0)
+ return -EINVAL;
+
for (j = 0; j < m_count; j++) {
if (m_list[j] == start_block)
return (++j * SQFS_METADATA_BLOCK_SIZE) + offset;