xfs_io: fix null pointer deref when complaining about scrub command
PATCH 1/1 xfs_io: fix null pointer deref when complaining about scrub command
From: Darrick J. Wong <[email protected]>
Don't increment optind until we've validated that argv[optind] is a valid scrub/repair subcommand and do not need to complain about argv[optind].
--- io/scrub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
io/scrub.c +1 -2
@@ -166,12 +166,11 @@ parse_args(break ; } } - optind++; -if (type <0 ) {printf (_ ("Unknown type '%s'.\n" ), argv[optind]);return command_usage (cmdinfo); } + optind++;switch (d->type) {case ST_INODE :
Quoted 7 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Don't increment optind until we've validated that argv[optind] is a valid scrub/repair subcommand and do not need to complain about argv[optind].
Signed-off-by Darrick J. Wong <[email protected]>
Quoted 22 lines
--- io/scrub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)io/scrub.c +1
-2@@ -166,12 +166,11 @@ parse_args(break ; } } - optind++; -if (type <0 ) {printf (_ ("Unknown type '%s'.\n" ), argv[optind]);return command_usage (cmdinfo); } + optind++;switch (d->type) {case ST_INODE :
Quoted 7 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Don't increment optind until we've validated that argv[optind] is a valid scrub/repair subcommand and do not need to complain about argv[optind].
Signed-off-by Darrick J. Wong <[email protected]>
Quoted 26 lines
--- io/scrub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)io/scrub.c +1
-3@@ -166,12 +166,11 @@ parse_args(break ; } } - optind++; -if (type <0 ) {printf (_ ("Unknown type '%s'.\n" ), argv[optind]);return command_usage (cmdinfo); } + optind++;switch (d->type) {case ST_INODE : --To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html