From f27d676a147f3b2bea4397b4d78528abdb57e410 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Wed, 28 Oct 2015 17:45:25 +0100 Subject: [PATCH] sanitize nrequests option fixes CID 27924 found by Coverity --- sched/sched_driver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sched/sched_driver.cpp b/sched/sched_driver.cpp index 89ec8b0788..694e0c76ba 100644 --- a/sched/sched_driver.cpp +++ b/sched/sched_driver.cpp @@ -164,6 +164,8 @@ int main(int argc, char** argv) { exit(1); } nrequests = atoi(argv[i]); + if (nrequests < 0) nrequests = 0; + if (nrequests > 10000000) nrequests = 10000000; } else if (!strcmp(argv[i], "--reqs_per_second")) { if (!argv[++i]) {