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

Commit 266f5822 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by Matt Wagantall
Browse files

UBIFS: add a couple of extra asserts



... to catch possible memory corruptions.

Change-Id: I216165e8b8c897c228e88d44ccfb9a343fbf204a
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Git-commit: fb4325a3d9f983160f142b919880ccbe2304bc25
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parent a41b96e4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2032,6 +2032,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
		long long blk_offs;
		struct ubifs_data_node *dn = node;

		ubifs_assert(zbr->len >= UBIFS_DATA_NODE_SZ);

		/*
		 * Search the inode node this data node belongs to and insert
		 * it to the RB-tree of inodes.
@@ -2060,6 +2062,8 @@ static int check_leaf(struct ubifs_info *c, struct ubifs_zbranch *zbr,
		struct ubifs_dent_node *dent = node;
		struct fsck_inode *fscki1;

		ubifs_assert(zbr->len >= UBIFS_DENT_NODE_SZ);

		err = ubifs_validate_entry(c, dent);
		if (err)
			goto out_dump;