From ed8ce60845dc0568840c64c692838136f342fa54 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 21 Jul 2012 15:51:15 +0200 Subject: [PATCH] Fix crash when no netname is specified. --- src/tincctl.c | 2 +- src/tincd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tincctl.c b/src/tincctl.c index 24359ab..ca354bc 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -192,7 +192,7 @@ static bool parse_options(int argc, char **argv) { /* netname "." is special: a "top-level name" */ - if(!strcmp(netname, ".")) { + if(netname && !strcmp(netname, ".")) { free(netname); netname = NULL; } diff --git a/src/tincd.c b/src/tincd.c index 85aee39..9879ecb 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -231,7 +231,7 @@ static bool parse_options(int argc, char **argv) { /* netname "." is special: a "top-level name" */ - if(!strcmp(netname, ".")) { + if(netname && !strcmp(netname, ".")) { free(netname); netname = NULL; } -- 2.25.1