mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
controlapi/getchannel: fix possible crash when channel = NULL
Origin commit data
------------------
Branch: ni/coolstream
Commit: 72cec30e97
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-24 (Wed, 24 Feb 2016)
Origin message was:
------------------
- controlapi/getchannel: fix possible crash when channel = NULL
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1298,6 +1298,8 @@ void CControlAPI::GetChannelCGI(CyhookHandler *hh)
|
||||
{
|
||||
hh->outStart();
|
||||
|
||||
std::string result = "";
|
||||
|
||||
t_channel_id channel_id = 0;
|
||||
if (hh->ParamList["id"].empty())
|
||||
channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
||||
@@ -1308,11 +1310,15 @@ void CControlAPI::GetChannelCGI(CyhookHandler *hh)
|
||||
{
|
||||
NeutrinoAPI->GetChannelEvents();
|
||||
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id);
|
||||
std::string result = _GetBouquetWriteItem(hh, channel, -1, -1);
|
||||
if (channel)
|
||||
{
|
||||
result = _GetBouquetWriteItem(hh, channel, -1, -1);
|
||||
result = hh->outArray("channel", result);
|
||||
|
||||
hh->SendResult(result);
|
||||
}
|
||||
else
|
||||
hh->SendError(hh->ParamList["id"] + " seems wrong");
|
||||
}
|
||||
else
|
||||
hh->SendError();
|
||||
}
|
||||
|
Reference in New Issue
Block a user