]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tvhlog: fix NULL dereference crash
authorJaroslav Kysela <perex@perex.cz>
Wed, 28 Nov 2018 12:18:58 +0000 (13:18 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 28 Nov 2018 12:18:58 +0000 (13:18 +0100)
src/tvhlog.c

index f895289aa04117b391bd2ca9bedb9793cf7abc6c..93be89c4f6e25b2632c85823b051a985f9e7295c 100644 (file)
@@ -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);