From 078b46d19bdebe58e4caf02a857440cf760fad6d Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 16 Dec 2015 08:32:30 -0700 Subject: [PATCH] parse: fix segfault if posval option doesn't have a value If the user did continue_on_error in the job file without setting one of the possible values for that option, we'd crash in string compare. Now fio will exit in error, showing the valid options instead. Signed-off-by: Jens Axboe --- parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parse.c b/parse.c index df42e227..0ef00b81 100644 --- a/parse.c +++ b/parse.c @@ -483,6 +483,8 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, if (!vp->ival || vp->ival[0] == '\0') continue; all_skipped = 0; + if (!ptr) + break; if (!strncmp(vp->ival, ptr, str_match_len(vp, ptr))) { ret = 0; if (o->off1) -- 2.25.1