]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: make iter reset more robust [coverity scan]
authorKarel Zak <kzak@redhat.com>
Mon, 30 Jan 2012 22:55:26 +0000 (23:55 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Jan 2012 22:55:26 +0000 (23:55 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/iter.c

index 99fedd17b864ca54190fd36dce2c484568a08ad9..393c23eb284f90ab367ae7707573f2938e2bafbd 100644 (file)
@@ -56,7 +56,7 @@ void mnt_reset_iter(struct libmnt_iter *itr, int direction)
 {
        assert(itr);
 
-       if (direction == -1)
+       if (direction == -1 && itr)
                direction = itr->direction;
 
        if (itr) {