From: Darrick J. Wong Date: Sat, 8 Nov 2014 02:26:14 +0000 (-0500) Subject: dumpe2fs: don't crash when the user provides no block device argument X-Git-Tag: v1.42.13~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fecb231f6fc83cf4b4ddf7ec34ace3723803a499;p=thirdparty%2Fe2fsprogs.git dumpe2fs: don't crash when the user provides no block device argument 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 Signed-off-by: Theodore Ts'o --- diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index 1eae5a336..4185d6ee1 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -575,7 +575,7 @@ int main (int argc, char ** argv) usage(); } } - if (argc - 1 > optind) { + if (optind != argc - 1) { usage(); exit(1); }