Whamcloud - gitweb
e2fsck: fix dangling pointer when dir_info array is resized
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 5 Nov 2014 16:14:26 +0000 (11:14 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 5 Nov 2014 16:14:26 +0000 (11:14 -0500)
commitbeec19ff21d41c84dbbc2ab8d0df25147912ff59
treecad291d270eeea37b474fb2d034c31f732051f72
parentea9085c711e92c3727538a0637bc805141333d83
e2fsck: fix dangling pointer when dir_info array is resized

e2fsck uses an array to store directory usage information during pass
3; the usage context also contains a pointer to the last directory
looked up.  When expanding the dir_info array, this cache pointer
needs to be cleared if the array resize changed the pointer location,
or else we'll later walk off the end of this dead pointer.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reported-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/dirinfo.c