From 3f3e47d28032991c4e9f02ef54c21cb5ec196b47 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 1 Jan 2021 21:23:00 +0100 Subject: Fixed a crash in the SVDRP command CLRE in case a non-existing channel number is given --- svdrp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'svdrp.c') diff --git a/svdrp.c b/svdrp.c index 8adf0e0c..b3c4c350 100644 --- a/svdrp.c +++ b/svdrp.c @@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 5.1 2020/12/26 15:49:01 kls Exp $ + * $Id: svdrp.c 5.2 2021/01/01 21:23:00 kls Exp $ */ #include "svdrp.h" @@ -1301,8 +1301,10 @@ void cSVDRPServer::CmdCLRE(const char *Option) tChannelID ChannelID = tChannelID::InvalidID; if (isnumber(Option)) { int o = strtol(Option, NULL, 10); - if (o >= 1 && o <= cChannels::MaxNumber()) - ChannelID = Channels->GetByNumber(o)->GetChannelID(); + if (o >= 1 && o <= cChannels::MaxNumber()) { + if (const cChannel *Channel = Channels->GetByNumber(o)) + ChannelID = Channel->GetChannelID(); + } } else { ChannelID = tChannelID::FromString(Option); -- cgit v1.2.3