From fecb231f6fc83cf4b4ddf7ec34ace3723803a499 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 7 Nov 2014 21:26:14 -0500 Subject: [PATCH] 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 --- misc/dumpe2fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index 1eae5a3..4185d6e 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); } -- 1.8.3.1