X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=ca354bc08957a39296f7a80c6bae7667978f8a4e;hb=ed8ce60845dc0568840c64c692838136f342fa54;hp=f547639a8460232443b2a2baf8689b8148b5d823;hpb=33521eabd4501b4add35468618453ac4f76311f3;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index f547639a..ca354bc0 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; } @@ -1194,7 +1194,7 @@ static int cmd_config(int argc, char *argv[]) { while(fgets(buf1, sizeof buf1, f)) { buf1[sizeof buf1 - 1] = 0; - strcpy(buf2, buf1); + strncpy(buf2, buf1, sizeof buf2); // Parse line in a simple way char *bvalue;