Skip to content

Commit e7ee11f

Browse files
author
Phillip Lougher
committed
Squashfs: add missing check in zlib_wrapper
On file system corruption zlib can return Z_STREAM_OK with input buffers remaining, which will not be released. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
1 parent 170cf02 commit e7ee11f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎fs/squashfs/zlib_wrapper.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ static int zlib_uncompress(struct squashfs_sb_info *msblk, void **buffer,
127127
goto release_mutex;
128128
}
129129

130+
if (k < b) {
131+
ERROR("zlib_uncompress error, data remaining\n");
132+
goto release_mutex;
133+
}
134+
130135
length = stream->total_out;
131136
mutex_unlock(&msblk->read_data_mutex);
132137
return length;

0 commit comments

Comments
 (0)