Unverified Commit 5865ef7f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14582 jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree

parents b762e8dd 77b53030
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2955,6 +2955,9 @@ static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl)
	/* bubble the new value up the tree as required.
	/* bubble the new value up the tree as required.
	 */
	 */
	for (k = 0; k < le32_to_cpu(tp->dmt_height); k++) {
	for (k = 0; k < le32_to_cpu(tp->dmt_height); k++) {
		if (lp == 0)
			break;

		/* get the index of the first leaf of the 4 leaf
		/* get the index of the first leaf of the 4 leaf
		 * group containing the specified leaf (leafno).
		 * group containing the specified leaf (leafno).
		 */
		 */