diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2021-01-02 15:18:06 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2021-01-02 15:18:06 +0100 |
commit | 5f1e08f606d3e2b136edb8e1a241f674e03deedc (patch) | |
tree | dd83fe436de84786fe0b549b8d3edb0dc9f618ab /svdrp.c | |
parent | 9f4c5cd785105855bd73e58154bf7830bee4dd9e (diff) | |
download | vdr-5f1e08f606d3e2b136edb8e1a241f674e03deedc.tar.gz vdr-5f1e08f606d3e2b136edb8e1a241f674e03deedc.tar.bz2 |
Fixed a crash in the SVDRP command CLRE in case a non-existing channel number is given
Diffstat (limited to 'svdrp.c')
-rw-r--r-- | svdrp.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 4.43 2020/06/22 20:59:49 kls Exp $ + * $Id: svdrp.c 4.43.1.1 2021/01/02 15:18:06 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); |