summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-12-16 08:32:30 -0700
committerJens Axboe <axboe@fb.com>2015-12-16 08:32:30 -0700
commit078b46d19bdebe58e4caf02a857440cf760fad6d (patch)
treeff699a72400b225d591d05f291aa1dae2812d263 /parse.c
parentbc0fec0e12f19dd424f4bf83cfca89d434184c8d (diff)
downloadfio-078b46d19bdebe58e4caf02a857440cf760fad6d.tar.gz
fio-078b46d19bdebe58e4caf02a857440cf760fad6d.tar.bz2
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 <axboe@fb.com>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c2
1 files changed, 2 insertions, 0 deletions
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)