From: Feideus Date: Sun, 24 Jun 2018 09:35:21 +0000 (+0200) Subject: getopt blindly accepting negative input fix X-Git-Tag: v0.11.0~365 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e6a2ce56b18b17f4fc8de08e81704c215643807d;p=oweals%2Fgnunet.git getopt blindly accepting negative input fix --- diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c index c55b22fb6..32cce65dd 100644 --- a/src/util/getopt_helpers.c +++ b/src/util/getopt_helpers.c @@ -748,6 +748,13 @@ set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, unsigned int *val = scls; (void) ctx; + if('-' == *value) + { + FPRINTF (stderr, + _("Your input for the '%s' option has to be a non negative number \n"), + option); + return GNUNET_SYSERR; + } if (1 != SSCANF (value, "%u", val))