[PATCH 03/47] dumpe2fs: don't crash when the user provides no block device argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the user doesn't provide any arguments, the guard fails to run and
the whole thing segfaults on ext2fs_open2().  Don't do that.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 misc/dumpe2fs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c
index e565f2d..26f2e37 100644
--- a/misc/dumpe2fs.c
+++ b/misc/dumpe2fs.c
@@ -656,7 +656,7 @@ int main (int argc, char ** argv)
 			usage();
 		}
 	}
-	if (argc - 1 > optind) {
+	if (optind != argc - 1) {
 		usage();
 		exit(1);
 	}

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux