Skip to content

Commit

Permalink
fix segfault when config file is empty and connecting without password
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman committed Dec 13, 2019
1 parent 969e78d commit 986047a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ int main(int argc, char **argv)
cfg.password = strdup(tmp_password); // copy string of correct size
free(tmp_password);
}
if (cfg.password == NULL)
cfg.password = strdup("");
log_debug("Config host = \"%s\"\n", cfg.gateway_host);
log_debug("Config realm = \"%s\"\n", cfg.realm);
log_debug("Config port = \"%d\"\n", cfg.gateway_port);
Expand Down

0 comments on commit 986047a

Please sign in to comment.