From 0dedd011eddf870c2f17e0811a36b0984aa09866 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 30 Jan 2014 17:10:46 -0500 Subject: [PATCH] quota: fix uninitiaized memory reference in mke2fs with quota enabled Initialize the on-disk structure before we fill it in, to avoid the following valgrind warning: Conditional jump or move depends on uninitialised value(s) at 0x4323A8: qtree_entry_unused (quotaio_tree.c:40) by 0x431218: v2r1_mem2diskdqblk (quotaio_v2.c:85) by 0x432409: qtree_write_dquot (quotaio_tree.c:336) by 0x431136: v2_commit_dquot (quotaio_v2.c:264) by 0x42FB63: quota_write_inode (mkquota.c:126) by 0x408BE6: create_quota_inodes (mke2fs.c:2466) by 0x409A2D: main (mke2fs.c:2850) Signed-off-by: "Theodore Ts'o" --- lib/quota/quotaio_tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/quota/quotaio_tree.c b/lib/quota/quotaio_tree.c index 5b47db4..4d7a9ab 100644 --- a/lib/quota/quotaio_tree.c +++ b/lib/quota/quotaio_tree.c @@ -329,6 +329,7 @@ void qtree_write_dquot(struct dquot *dquot) (unsigned int)dquot->dq_id, strerror(errno)); return; } + memset(ddquot, 0, info->dqi_entry_size); if (!dquot->dq_dqb.u.v2_mdqb.dqb_off) dq_insert_tree(dquot->dq_h, dquot); -- 1.8.3.1