summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-01-02 15:05:48 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2021-01-02 15:05:48 +0100
commit3211df30df43960f04645371f6f923a60ce4f681 (patch)
tree8f6d574f47aa64cb32aedd0fbfc3f9bff4cb6154
parentd2e0087c4e13b2acbecc4bafb3cb2ab656c95339 (diff)
downloadvdr-3211df30df43960f04645371f6f923a60ce4f681.tar.gz
vdr-3211df30df43960f04645371f6f923a60ce4f681.tar.bz2
Fixed strreplace() to handle NULL strings
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY4
-rw-r--r--tools.c4
3 files changed, 9 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index ed8ca4fa..5e776738 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3655,6 +3655,8 @@ Jürgen Schneider <jsffm@web.de>
for reporting a possible discrepancy of the primary device number in the LSTD and
PRIM commands
for adding support for EAC3 audio from other sources
+ for reporting a crash if a pattern timer spawns a timer that uses EPISODE and the
+ event has no short text
Stefan Verse <Verse@amotronics.de>
for fixing an occasional black screen when switching channels
diff --git a/HISTORY b/HISTORY
index 77b4f9af..f68dd810 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9562,3 +9562,7 @@ Video Disk Recorder Revision History
- Fixed a compiler warning (thanks to Winfried Köhler).
- Fixed convertCharacterTable() in case iconv_open() fails (thanks to Helmut Binder).
- Official release.
+
+2021-01-02: Version 2.4.7
+
+- Fixed strreplace() to handle NULL strings (reported by Jürgen Schneider).
diff --git a/tools.c b/tools.c
index 3a3a1143..03b4c43d 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 4.13 2020/11/22 13:32:05 kls Exp $
+ * $Id: tools.c 4.13.1.1 2021/01/02 15:05:48 kls Exp $
*/
#include "tools.h"
@@ -151,6 +151,8 @@ char *strreplace(char *s, char c1, char c2)
char *strreplace(char *s, const char *s1, const char *s2)
{
+ if (!s || !s1 || !s2)
+ return s;
char *p = strstr(s, s1);
if (p) {
int of = p - s;