Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
wizard: fix string NULL pointer dereference - coverity
  • Loading branch information
perexg committed May 23, 2016
1 parent 65c7d32 commit da01d22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wizard.c
Expand Up @@ -307,7 +307,7 @@ static void login_changed(idnode_t *in)
passwd_entry_destroy(pw, 1);
}

s = w->admin_username[0] ? w->admin_username : "*";
s = w->admin_username[0] ? (w->admin_username ?: "") : "*";
conf = htsmsg_create_map();
htsmsg_add_bool(conf, "enabled", 1);
htsmsg_add_str(conf, "prefix", w->network);
Expand All @@ -326,7 +326,7 @@ static void login_changed(idnode_t *in)
}
htsmsg_destroy(conf);

if (s && s[0] != '*' && w->admin_password[0]) {
if (s[0] != '*' && w->admin_password[0]) {
conf = htsmsg_create_map();
htsmsg_add_bool(conf, "enabled", 1);
htsmsg_add_str(conf, "username", s);
Expand Down

0 comments on commit da01d22

Please sign in to comment.