app/crypto-perf: add options parsing check
Added total_ops value validation in parse_total_ops() function. Coverity issue: 141070 Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Signed-off-by: Kuba Kozak <kubax.kozak@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
parent
8ecd4048ba
commit
d27befd0b6
@ -128,7 +128,13 @@ parse_total_ops(struct cperf_options *opts, const char *arg)
|
||||
int ret = parse_uint32_t(&opts->total_ops, arg);
|
||||
|
||||
if (ret)
|
||||
RTE_LOG(ERR, USER1, "failed to parse total operations count");
|
||||
RTE_LOG(ERR, USER1, "failed to parse total operations count\n");
|
||||
|
||||
if (opts->total_ops == 0) {
|
||||
RTE_LOG(ERR, USER1,
|
||||
"invalid total operations count number specified\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user