From 616fa9c7b335117243c0c157a6c45445e20fdfa0 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 9 Jul 2013 00:46:39 +0100 Subject: df: fix mount list processing with unstatable mount dirs * src/df.c (filter_mount_list): Initialize devlist->dev_num correctly when unable to stat() a mount point. This will avoid possible invalid deduplication done on the list due to use of uninitialized memory. * tests/df/skip-duplicates.sh: Ensure this code path is exercised. Also refactor the test to be table driven. * NEWS: Mention the bug fix. --- src/df.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/df.c b/src/df.c index 051513196..bc507c72e 100644 --- a/src/df.c +++ b/src/df.c @@ -620,7 +620,8 @@ filter_mount_list (void) if (-1 == stat (me->me_mountdir, &buf)) { - ; /* Stat failed - add ME to be able to complain about it later. */ + /* Stat failed - add ME to be able to complain about it later. */ + buf.st_dev = me->me_dev; } else { -- cgit v1.2.3-70-g09d2