From: Jaroslav Kysela Date: Fri, 13 Nov 2015 17:06:46 +0000 (+0100) Subject: channels: fix possible NULL dereference X-Git-Tag: v4.2.1~1555 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=280a8f532378793abc4b1436743edd85ee661a13;p=thirdparty%2Ftvheadend.git channels: fix possible NULL dereference --- diff --git a/src/channels.c b/src/channels.c index facbd9a1a..f049fd5dc 100644 --- a/src/channels.c +++ b/src/channels.c @@ -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;