diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-09 09:21:04 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-09 09:21:04 +0000 |
commit | 445b8e7072bc4a0d443f7e95d9694e4224c3ce53 (patch) | |
tree | b0e796b622c15dadbbc21e060394f70b2902b63d /src/ats-tool | |
parent | dea72e1e1b8173ac648778f0b2c2c2981e217b36 (diff) | |
download | gnunet-445b8e7072bc4a0d443f7e95d9694e4224c3ce53.tar.gz gnunet-445b8e7072bc4a0d443f7e95d9694e4224c3ce53.zip |
fix segfault on missing type
Diffstat (limited to 'src/ats-tool')
-rw-r--r-- | src/ats-tool/gnunet-ats.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index 32813c3a0..1e2d347e7 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c | |||
@@ -418,6 +418,12 @@ testservice_ats (void *cls, | |||
418 | } | 418 | } |
419 | else if (op_set_pref) | 419 | else if (op_set_pref) |
420 | { | 420 | { |
421 | if (NULL == type_str) | ||
422 | { | ||
423 | fprintf (stderr, "No preference type given!\n"); | ||
424 | return; | ||
425 | } | ||
426 | |||
421 | for (c = 0; c<strlen(type_str); c++) | 427 | for (c = 0; c<strlen(type_str); c++) |
422 | { | 428 | { |
423 | if (isupper (type_str[c])) | 429 | if (isupper (type_str[c])) |
@@ -484,6 +490,7 @@ main (int argc, char *const *argv) | |||
484 | op_set_pref = GNUNET_NO; | 490 | op_set_pref = GNUNET_NO; |
485 | pending = 0; | 491 | pending = 0; |
486 | receive_done = GNUNET_NO; | 492 | receive_done = GNUNET_NO; |
493 | type_str = NULL; | ||
487 | 494 | ||
488 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 495 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
489 | {'u', "used", NULL, | 496 | {'u', "used", NULL, |