]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
wizard: fix string NULL pointer dereference - coverity
authorJaroslav Kysela <perex@perex.cz>
Mon, 23 May 2016 19:32:22 +0000 (21:32 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 May 2016 19:32:22 +0000 (21:32 +0200)
src/wizard.c

index 3f24ebeba3b5b9e9796a09118766547210e4aaf0..3100aab266799614648e5e5764bb4d1e9e537275 100644 (file)
@@ -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);