projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
71eef2a
)
getopt blindly accepting negative input fix
author
Feideus
<erwan.ulrich@gmail.com>
Sun, 24 Jun 2018 09:35:21 +0000
(11:35 +0200)
committer
Feideus
<erwan.ulrich@gmail.com>
Sun, 24 Jun 2018 10:17:43 +0000
(12:17 +0200)
src/util/getopt_helpers.c
patch
|
blob
|
history
diff --git
a/src/util/getopt_helpers.c
b/src/util/getopt_helpers.c
index c55b22fb622f2a1c53adbad8fbec1b37e68c5701..32cce65dd2e44cb57d0b05b8c861b5d97c6a93ac 100644
(file)
--- 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))