sanitize nrequests option

fixes CID 27924 found by Coverity
This commit is contained in:
Christian Beer 2015-10-28 17:45:25 +01:00
parent 28e3c3740c
commit f27d676a14
1 changed files with 2 additions and 0 deletions

View File

@ -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]) {