gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27818 - gnunet/src/ats-tool


From: gnunet
Subject: [GNUnet-SVN] r27818 - gnunet/src/ats-tool
Date: Tue, 9 Jul 2013 11:21:04 +0200

Author: wachs
Date: 2013-07-09 11:21:04 +0200 (Tue, 09 Jul 2013)
New Revision: 27818

Modified:
   gnunet/src/ats-tool/gnunet-ats.c
Log:
fix segfault on missing type


Modified: gnunet/src/ats-tool/gnunet-ats.c
===================================================================
--- gnunet/src/ats-tool/gnunet-ats.c    2013-07-09 09:13:40 UTC (rev 27817)
+++ gnunet/src/ats-tool/gnunet-ats.c    2013-07-09 09:21:04 UTC (rev 27818)
@@ -418,6 +418,12 @@
     }
     else if (op_set_pref)
     {
+               if (NULL == type_str)
+               {
+                       fprintf (stderr, "No preference type given!\n");
+                       return;
+               }
+
         for (c = 0; c<strlen(type_str); c++)
         {
           if (isupper (type_str[c]))
@@ -484,6 +490,7 @@
   op_set_pref = GNUNET_NO;
   pending = 0;
   receive_done = GNUNET_NO;
+  type_str = NULL;
 
   static const struct GNUNET_GETOPT_CommandLineOption options[] = {
       {'u', "used", NULL,




reply via email to

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