diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2021-01-01 21:23:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2021-01-01 21:23:00 +0100 |
commit | 3f3e47d28032991c4e9f02ef54c21cb5ec196b47 (patch) | |
tree | a8ed38e1fd4c5319c8afb639ecb6f33304ea1959 | |
parent | 40ca081ff4e360c383a66c627df4c467c04e5913 (diff) | |
download | vdr-3f3e47d28032991c4e9f02ef54c21cb5ec196b47.tar.gz vdr-3f3e47d28032991c4e9f02ef54c21cb5ec196b47.tar.bz2 |
Fixed a crash in the SVDRP command CLRE in case a non-existing channel number is given
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | svdrp.c | 8 |
3 files changed, 9 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5e776738..b983bf74 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2938,6 +2938,8 @@ Manuel Reimer <Manuel.Reimer@gmx.de> for reporting a bug in moving channels between number groups in SVDRP's MOVC command for fixing compatibility with current versions of glibc for suggesting to make the SVDRP command DELC accept a channel id + for reporting a crash in the SVDRP command CLRE in case a non-existing channel + number is given Rene van den Braken <rene@vandenbraken.name> for reporting a bug in writing the PCR pid into the PMT in @@ -9575,3 +9575,5 @@ Video Disk Recorder Revision History - Somewhere down the road the 'x' bit of Doxyfile.filter got lost, so the Makefile now makes sure it is set before calling doxygen. - Using strgetlast() in more places. +- Fixed a crash in the SVDRP command CLRE in case a non-existing channel number is + given (reported by Manuel Reimer). @@ -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); |