]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
subscriptions: fix NULL deference, fixes #4308
authorJaroslav Kysela <perex@perex.cz>
Wed, 5 Apr 2017 13:48:04 +0000 (15:48 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 5 Apr 2017 13:48:04 +0000 (15:48 +0200)
src/subscriptions.c

index 56162477bd6d94316bd3d8ebe5d7899ffbe6502e..06c72168f67929e330692a2c475a0d2b20f5af25 100644 (file)
@@ -775,6 +775,7 @@ subscription_create
   s->ths_output            = st;
   s->ths_flags             = flags;
   s->ths_timeout           = pro ? pro->pro_timeout : 0;
+  s->ths_ca_timeout        = sec2mono(2);
   s->ths_postpone          = subscription_postpone;
   s->ths_postpone_end      = mclk() + sec2mono(s->ths_postpone);
   atomic_set(&s->ths_total_err, 0);
@@ -791,13 +792,10 @@ subscription_create
       s->ths_flags |= SUBSCRIPTION_CONTACCESS;
     if (pro->pro_swservice)
       s->ths_flags |= SUBSCRIPTION_SWSERVICE;
+    if (pro->pro_ca_timeout)
+      s->ths_ca_timeout = ms2mono(MINMAX(pro->pro_ca_timeout, 100, 5000));
   }
 
-  if (pro->pro_ca_timeout)
-    s->ths_ca_timeout = ms2mono(MINMAX(pro->pro_ca_timeout, 100, 5000));
-  else
-    s->ths_ca_timeout = sec2mono(2);
-
   time(&s->ths_start);
 
   s->ths_id = ++tally;