Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7ee11f0 authored by Phillip Lougher's avatar Phillip Lougher
Browse files

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: default avatarPhillip Lougher <phillip@lougher.demon.co.uk>
parent 170cf021
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -127,6 +127,11 @@ static int zlib_uncompress(struct squashfs_sb_info *msblk, void **buffer,
		goto release_mutex;
		goto release_mutex;
	}
	}


	if (k < b) {
		ERROR("zlib_uncompress error, data remaining\n");
		goto release_mutex;
	}

	length = stream->total_out;
	length = stream->total_out;
	mutex_unlock(&msblk->read_data_mutex);
	mutex_unlock(&msblk->read_data_mutex);
	return length;
	return length;