Unverified Commit 3cb1031f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13225 fs/ntfs3: Check if more than chunk-size bytes are written

parents cdfa4d0c addd9084
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -236,6 +236,9 @@ static inline ssize_t decompress_chunk(u8 *unc, u8 *unc_end, const u8 *cmpr,

	/* Do decompression until pointers are inside range. */
	while (up < unc_end && cmpr < cmpr_end) {
		// return err if more than LZNT_CHUNK_SIZE bytes are written
		if (up - unc > LZNT_CHUNK_SIZE)
			return -EINVAL;
		/* Correct index */
		while (unc + s_max_off[index] < up)
			index += 1;