aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tool
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-07-09 09:21:04 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-07-09 09:21:04 +0000
commit445b8e7072bc4a0d443f7e95d9694e4224c3ce53 (patch)
treeb0e796b622c15dadbbc21e060394f70b2902b63d /src/ats-tool
parentdea72e1e1b8173ac648778f0b2c2c2981e217b36 (diff)
fix segfault on missing type
Diffstat (limited to 'src/ats-tool')
-rw-r--r--src/ats-tool/gnunet-ats.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 32813c3a0f..1e2d347e7d 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -418,6 +418,12 @@ testservice_ats (void *cls,
}
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 @@ main (int argc, char *const *argv)
op_set_pref = GNUNET_NO;
pending = 0;
receive_done = GNUNET_NO;
+ type_str = NULL;
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'u', "used", NULL,