From 424faaa6a9144695da845ae57ce90c1d0abda8db Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Mon, 5 Jun 2017 12:30:24 +0100 Subject: gem_wsim: Detect invalid duration range Maximum has to be larger than minimum and all values positive. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'benchmarks/gem_wsim.c') diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index b6e10ae1..df588fe1 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -444,7 +444,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) fstart = NULL; tmpl = strtol(field, &sep, 10); - if (tmpl == 0 || tmpl == LONG_MIN || tmpl == LONG_MAX) { + if (tmpl <= 0 || tmpl == LONG_MIN || tmpl == LONG_MAX) { if (verbose) fprintf(stderr, "Invalid duration at step %u!\n", @@ -455,7 +455,7 @@ parse_workload(struct w_arg *arg, unsigned int flags, struct workload *app_w) if (sep && *sep == '-') { tmpl = strtol(sep + 1, NULL, 10); - if (tmpl == 0 || + if (tmpl <= 0 || tmpl <= step.duration.min || tmpl == LONG_MIN || tmpl == LONG_MAX) { if (verbose) fprintf(stderr, -- cgit v1.2.3