From 5e2770a0e5b1a9bb7bd841c703616d7fb0e9f29b Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Wed, 14 May 2014 22:14:59 +0300 Subject: [PATCH] Added a validity check for the session member. --- tuner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tuner.c b/tuner.c index 73ae41f..cbf32ca 100644 --- a/tuner.c +++ b/tuner.c @@ -26,7 +26,7 @@ cSatipTuner::cSatipTuner(cSatipDeviceIf &deviceP, unsigned int packetLenP) headerListM(NULL), keepAliveM(), pidUpdateCacheM(), - sessionM(), + sessionM(""), timeoutM(eMinKeepAliveIntervalMs), openedM(false), tunedM(false), @@ -240,7 +240,7 @@ bool cSatipTuner::Connect(void) // Session id is now known - disable header parsing SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_HEADERFUNCTION, NULL); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_WRITEHEADER, NULL); - if (nextServerM && nextServerM->Quirk(cSatipServer::eSatipQuirkSessionId) && startswith(*sessionM, "0")) { + if (nextServerM && nextServerM->Quirk(cSatipServer::eSatipQuirkSessionId) && !isempty(*sessionM) && startswith(*sessionM, "0")) { debug("cSatipTuner::%s(): session id quirk [device %d]", __FUNCTION__, deviceM->GetId()); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM + 1); }