diff options
author | Feideus <erwan.ulrich@gmail.com> | 2018-06-24 11:35:21 +0200 |
---|---|---|
committer | Feideus <erwan.ulrich@gmail.com> | 2018-06-24 12:17:43 +0200 |
commit | e6a2ce56b18b17f4fc8de08e81704c215643807d (patch) | |
tree | 64a24beb6c7177f564cf8592983985a8733e6a41 /src/util/getopt_helpers.c | |
parent | 71eef2a19df159f26c653db3aaf3e6cb89886cd4 (diff) | |
download | gnunet-e6a2ce56b18b17f4fc8de08e81704c215643807d.tar.gz gnunet-e6a2ce56b18b17f4fc8de08e81704c215643807d.zip |
getopt blindly accepting negative input fix
Diffstat (limited to 'src/util/getopt_helpers.c')
-rw-r--r-- | src/util/getopt_helpers.c | 7 |
1 files changed, 7 insertions, 0 deletions
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, | |||
748 | unsigned int *val = scls; | 748 | unsigned int *val = scls; |
749 | 749 | ||
750 | (void) ctx; | 750 | (void) ctx; |
751 | if('-' == *value) | ||
752 | { | ||
753 | FPRINTF (stderr, | ||
754 | _("Your input for the '%s' option has to be a non negative number \n"), | ||
755 | option); | ||
756 | return GNUNET_SYSERR; | ||
757 | } | ||
751 | if (1 != SSCANF (value, | 758 | if (1 != SSCANF (value, |
752 | "%u", | 759 | "%u", |
753 | val)) | 760 | val)) |