VDR 1.3.32 crashes if recording date is in the future
Commit Message
Marco Kremer wrote:
> Hi Klaus,
>
> I tried 1.3.32 (plain, only remote-Plugin) and it always crashed with a
> "Speicherzugriffsfehler". I tried to debug it (i'm no programmer at all) and
> it fails at
>
> [Switching to Thread -1208472992 (LWP 18423)]
> 0x080cb1d6 in cRecording (this=0x840f170,
> FileName=0x840f114
> "Chaos_City/1x01_-_001_-_New_York_New_York_(Pilot)/2007-01-01.00.12.10.99.re
> c") at recording.c:506
> 506 data[1] = (char *)realloc(data[1], len + 1 +
> strlen(data[2]) + 1);
>
> I use future dates to reorder my recordings -> this doesn't happen with
> vdr-1.3.28.
>
> Could this be changed ?
See the patch posted here by Achim Tuffentsammer <a.tuffentsammer@web.de>
yesterday:
Klaus
Comments
vdr-bounces@linuxtv.org wrote:
>> Could this be changed ?
>
> See the patch posted here by Achim Tuffentsammer
> <a.tuffentsammer@web.de>
> yesterday:
>
> --- recording-org.c 2005-09-15 19:25:49.000000000 +0200
> +++ recording.c 2005-09-15 19:26:15.000000000 +0200
> @@ -500,7 +500,7 @@
> // if line 1 is too long, it can't be the short text,
> // so assume the short text is missing and concatenate
> // line 1 and line 2 to be the long text:
> - int len = strlen(data[1]);
> + int len = ( data[1] ) ? strlen(data[1]) : 0;
> if (len > 80) {
> data[1] = (char *)realloc(data[1], len + 1 +
> strlen(data[2]) + 1); strcat(data[1], "\n");
It doesn't help:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208874400 (LWP 2948)]
0x080cb1e3 in cRecording (this=0x8409ba8,
FileName=0x840efc4
"Chaos_City/1x01_-_001_-_New_York_New_York_(Pilot)/2007-01-01.00.12.10.99.re
c") at recording.c:506
506 data[1] = (char *)realloc(data[1], len + 1 +
strlen(data[2]) + 1);
Current language: auto; currently c++
> Klaus
/hgm.bg
@@ -500,7 +500,7 @@
// if line 1 is too long, it can't be the short text,
// so assume the short text is missing and concatenate
// line 1 and line 2 to be the long text:
- int len = strlen(data[1]);
+ int len = ( data[1] ) ? strlen(data[1]) : 0;
if (len > 80) {
data[1] = (char *)realloc(data[1], len + 1 + strlen(data[2]) + 1);
strcat(data[1], "\n");