df: fix mount list processing with unstatable mount dirs
commit616fa9c7b335117243c0c157a6c45445e20fdfa0
authorPádraig Brady <P@draigBrady.com>
Mon, 8 Jul 2013 23:46:39 +0000 (9 00:46 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 9 Jul 2013 01:36:27 +0000 (9 02:36 +0100)
tree6bcd9572f2e7aa362638be64b9021104be6dbdda
parent8d2da3f58a82bd1813ca5c06f5692ad60a00559c
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.
NEWS
src/df.c
tests/df/skip-duplicates.sh