]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: initialize realloced bplist in longform_dir2_entry_check
authorEric Sandeen <sandeen@redhat.com>
Tue, 30 Oct 2018 21:51:55 +0000 (16:51 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 30 Oct 2018 21:51:55 +0000 (16:51 -0500)
commit1624c340a53012b4afd1194d990890c140e3fb66
treeddd77431eca61e7e20b1e66e259d22b8750f9881
parentf6302b0ffebb0bd04ff2e8635b4ef9fb33c7188a
xfs_repair: initialize realloced bplist in longform_dir2_entry_check

If we need to realloc the bplist[] array holding buffers for a given
directory, we don't initialize the new slots.  This causes a problem
if the directory has holes, because those slots never get filled in.

At the end of the function we call libxfs_putbuf for every non-null
slot, and any uninitialized slots are segfault landmines.

Make sure we initialize all new slots to NULL for this reason.

Reported-by: Oleg Davydov <burunduk3@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase6.c