]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: initialize movon in xfs_scrub_connections
authorEric Sandeen <sandeen@redhat.com>
Tue, 27 Mar 2018 22:43:37 +0000 (17:43 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 27 Mar 2018 22:43:37 +0000 (17:43 -0500)
Given the logic in xfs_scrub_connections, it's possible to
fail all 3 tests and wind up checking an uninitialized moveon
variable at the end.  Start out with "true" to avoid this and
move on even if all the conditions in the function are false.

Fixes-coverity-id: 1433617
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/phase5.c

index 8e0a1be974d607d956716af07d2a4560d2ec2423..5f2a1a7cd0a865d7427696f1cfd6f438e1cebe5b 100644 (file)
@@ -244,7 +244,7 @@ xfs_scrub_connections(
 {
        bool                    *pmoveon = arg;
        char                    descr[DESCR_BUFSZ];
-       bool                    moveon;
+       bool                    moveon = true;
        xfs_agnumber_t          agno;
        xfs_agino_t             agino;
        int                     fd = -1;