From 14e8429616a782002df61e15eb003b30dbd9df29 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 1 Dec 2016 14:39:07 +0100 Subject: Check that the value of -p is proper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/cg-base.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cg-base.c b/src/cg-base.c index a8c7f71..d9da32a 100644 --- a/src/cg-base.c +++ b/src/cg-base.c @@ -653,7 +653,13 @@ int main(int argc, char* argv[]) return 0; } else if (prio != NULL) - priority = (int64_t)atoll(prio); + { + char *end; + errno = 0; + priority = (int64_t)strtoll(prio, &end, 10); + if (errno || *end) + usage(); + } if (!nulstrcmp(rule, "??")) { -- cgit v1.2.3-70-g09d2