From: Jaroslav Kysela Date: Wed, 5 Apr 2017 13:48:04 +0000 (+0200) Subject: subscriptions: fix NULL deference, fixes #4308 X-Git-Tag: v4.2.1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77e6de9e1fe9b26b645c798905084c5d039e4d17;p=thirdparty%2Ftvheadend.git subscriptions: fix NULL deference, fixes #4308 --- diff --git a/src/subscriptions.c b/src/subscriptions.c index 56162477b..06c72168f 100644 --- a/src/subscriptions.c +++ b/src/subscriptions.c @@ -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;