From 006a529db11bb7050e0c925f7c76b2ff5023655a Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 30 May 2022 13:04:24 +0000 Subject: [PATCH] Check if args_strtonum argument is NULL or not a string, from Anindya Mukherjee. --- arguments.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arguments.c b/arguments.c index 37cd0236..c94a3a29 100644 --- a/arguments.c +++ b/arguments.c @@ -831,6 +831,12 @@ args_strtonum(struct args *args, u_char flag, long long minval, return (0); } value = TAILQ_LAST(&entry->values, args_values); + if (value == NULL || + value->type != ARGS_STRING || + value->string == NULL) { + *cause = xstrdup("missing"); + return (0); + } ll = strtonum(value->string, minval, maxval, &errstr); if (errstr != NULL) {