From: Jaroslav Kysela Date: Wed, 28 Nov 2018 12:18:58 +0000 (+0100) Subject: tvhlog: fix NULL dereference crash X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf3f0bd16983045a624ebe335eae507aadb4a690;p=thirdparty%2Ftvheadend.git tvhlog: fix NULL dereference crash --- diff --git a/src/tvhlog.c b/src/tvhlog.c index f895289aa..93be89c4f 100644 --- a/src/tvhlog.c +++ b/src/tvhlog.c @@ -582,7 +582,7 @@ tvhlog_init ( int level, int options, const char *path ) #if ENABLE_TRACE { const char *rtport0 = getenv("TVHEADEND_RTLOG_UDP_PORT"); - int rtport = atoi(rtport0); + int rtport = rtport0 ? atoi(rtport0) : 0; if (rtport > 0) { tvhlog_rtfd = tvh_socket(AF_INET, SOCK_DGRAM, 0); tcp_get_ip_from_str("127.0.0.1", &tvhlog_rtss);