From: Darrick J. Wong Date: Tue, 22 Aug 2017 15:01:30 +0000 (-0500) Subject: xfs_db: bit fuzzing should read the right bit when flipping X-Git-Tag: v4.13.0-rc1~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=592c10154f9928d6f44c18311f7edb4f4d7ff6de;p=thirdparty%2Fxfsprogs-dev.git xfs_db: bit fuzzing should read the right bit when flipping The middle and last bit flip fuzz verbs need to read the same bit that they're trying to set. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/db/fuzz.c b/db/fuzz.c index 53cedbc69..d0d78a943 100644 --- a/db/fuzz.c +++ b/db/fuzz.c @@ -226,7 +226,7 @@ fuzz_lastbit( int nbits) { setbit_l((char *)buf, bitoff + nbits - 1, - !getbit_l((char *)buf, bitoff)); + !getbit_l((char *)buf, bitoff + nbits - 1)); return true; } @@ -238,7 +238,7 @@ fuzz_middlebit( int nbits) { setbit_l((char *)buf, bitoff + nbits / 2, - !getbit_l((char *)buf, bitoff)); + !getbit_l((char *)buf, bitoff + nbits / 2)); return true; }