From: Jaroslav Kysela Date: Mon, 23 May 2016 19:32:22 +0000 (+0200) Subject: wizard: fix string NULL pointer dereference - coverity X-Git-Tag: v4.2.1~478 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da01d227c788febd11467fb1412c51876a0fb615;p=thirdparty%2Ftvheadend.git wizard: fix string NULL pointer dereference - coverity --- diff --git a/src/wizard.c b/src/wizard.c index 3f24ebeba..3100aab26 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -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); @@ -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);