Unverified Commit 5d20825c authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13411 udf: fix uninit-value use in udf_get_fileshortad

parents 5562ee0b 0df6d21c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2184,12 +2184,15 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
		alen = udf_file_entry_alloc_offset(inode) +
							iinfo->i_lenAlloc;
	} else {
		struct allocExtDesc *header =
			(struct allocExtDesc *)epos->bh->b_data;

		if (!epos->offset)
			epos->offset = sizeof(struct allocExtDesc);
		ptr = epos->bh->b_data + epos->offset;
		alen = sizeof(struct allocExtDesc) +
			le32_to_cpu(((struct allocExtDesc *)epos->bh->b_data)->
							lengthAllocDescs);
		if (check_add_overflow((int)sizeof(struct allocExtDesc),
				(int)le32_to_cpu(header->lengthAllocDescs), &alen))
			return -1;
	}

	switch (iinfo->i_alloc_type) {