gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: getopt blindly accepting ne


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: getopt blindly accepting negative input fix
Date: Sun, 24 Jun 2018 12:18:01 +0200

This is an automated email from the git hooks/post-receive script.

erwan-ulrich pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new e6a2ce56b getopt blindly accepting negative input fix
e6a2ce56b is described below

commit e6a2ce56b18b17f4fc8de08e81704c215643807d
Author: Feideus <address@hidden>
AuthorDate: Sun Jun 24 11:35:21 2018 +0200

    getopt blindly accepting negative input fix
---
 src/util/getopt_helpers.c | 7 +++++++
 1 file changed, 7 insertions(+)

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))

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]