summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2018-08-24 16:48:11 -0700
committerBart Van Assche <bvanassche@acm.org>2018-08-24 17:03:07 -0700
commitcbd6ce9c2a4089ad7ca87632d14f74047a1d36c2 (patch)
tree4b5acc69af37f5780e3b0619e79da53d8972fc0d /parse.c
parent9916f60af6e7b1ca05a1568d22d4010d08130fd6 (diff)
downloadfio-cbd6ce9c2a4089ad7ca87632d14f74047a1d36c2.tar.gz
fio-cbd6ce9c2a4089ad7ca87632d14f74047a1d36c2.tar.bz2
Fix the typehelp[] array
This patch fixes Coverity ID 183335 (Out-of-bounds access of typehelp[] array). Fixes: 5fff95436922 ("Add support for >= 4G block sizes") Fixes: c47537ee91cd ("parse: add support for soft deprecated options") Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/parse.c b/parse.c
index 952118c6..5d88d910 100644
--- a/parse.c
+++ b/parse.c
@@ -120,19 +120,22 @@ static void show_option_values(const struct fio_option *o)
static void show_option_help(const struct fio_option *o, int is_err)
{
const char *typehelp[] = {
- "invalid",
- "string (opt=bla)",
- "string (opt=bla)",
- "string with possible k/m/g postfix (opt=4k)",
- "string with time postfix (opt=10s)",
- "string (opt=bla)",
- "string with dual range (opt=1k-4k,4k-8k)",
- "integer value (opt=100)",
- "boolean value (opt=1)",
- "list of floating point values separated by ':' (opt=5.9:7.8)",
- "no argument (opt)",
- "deprecated",
- "unsupported",
+ [FIO_OPT_INVALID] = "invalid",
+ [FIO_OPT_STR] = "string (opt=bla)",
+ [FIO_OPT_STR_ULL] = "string (opt=bla)",
+ [FIO_OPT_STR_MULTI] = "string with possible k/m/g postfix (opt=4k)",
+ [FIO_OPT_STR_VAL] = "string (opt=bla)",
+ [FIO_OPT_STR_VAL_TIME] = "string with time postfix (opt=10s)",
+ [FIO_OPT_STR_STORE] = "string (opt=bla)",
+ [FIO_OPT_RANGE] = "one to three ranges (opt=1k-4k[,4k-8k[,1k-8k]])",
+ [FIO_OPT_INT] = "integer value (opt=100)",
+ [FIO_OPT_ULL] = "integer value (opt=100)",
+ [FIO_OPT_BOOL] = "boolean value (opt=1)",
+ [FIO_OPT_FLOAT_LIST] = "list of floating point values separated by ':' (opt=5.9:7.8)",
+ [FIO_OPT_STR_SET] = "empty or boolean value ([0|1])",
+ [FIO_OPT_DEPRECATED] = "deprecated",
+ [FIO_OPT_SOFT_DEPRECATED] = "deprecated",
+ [FIO_OPT_UNSUPPORTED] = "unsupported",
};
ssize_t (*logger)(const char *format, ...);