diff options
author | Pádraig Brady <P@draigBrady.com> | 2013-07-09 00:46:39 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2013-07-09 02:36:27 +0100 |
commit | 616fa9c7b335117243c0c157a6c45445e20fdfa0 (patch) | |
tree | 6bcd9572f2e7aa362638be64b9021104be6dbdda /src | |
parent | 8d2da3f58a82bd1813ca5c06f5692ad60a00559c (diff) | |
download | coreutils-616fa9c7b335117243c0c157a6c45445e20fdfa0.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/df.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 { |