]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
channels: fix possible NULL dereference
authorJaroslav Kysela <perex@perex.cz>
Fri, 13 Nov 2015 17:06:46 +0000 (18:06 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 13 Nov 2015 17:06:46 +0000 (18:06 +0100)
src/channels.c

index facbd9a1a3b7de8892fc1319210a23c87dc9b9c7..f049fd5dcaceb667b51c19e4f1fd2df249355e42 100644 (file)
@@ -92,7 +92,8 @@ channel_class_autoname_set ( void *obj, const void *p )
       free(ch->ch_name);
       ch->ch_name = strdup(s);
     } else if (b) {
-      ch->ch_name[0] = '\0';
+      if (ch->ch_name)
+        ch->ch_name[0] = '\0';
     }
     ch->ch_autoname = b;
     return 1;