VDR-1.3.46 Segmentation fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Darren Salt wrote:
> I demand that Dr. Werner Fink may or may not have written...
> 
> 
>>On Mon, Apr 10, 2006 at 02:50:35AM +0100, Darren Salt wrote:
>>
>>>I demand that I definitely did write...
> 
> 
>>>>I demand that Thomas G?nther may or may not have written...
>>>>
>>>>>If I try to set the time transponder the vdr crashes. :-( Program
>>>>>received signal SIGSEGV, Segmentation fault.
> 
> 
>>>>>(gdb) bt
>>>>>#0  0x401f4cff in strlen () from /lib/libc.so.6
>>>>>#1  0x401f4a55 in strdup () from /lib/libc.so.6
>>>>>#2  0x080e0b2f in cMenuEditItem::SetValue (this=0xa268768, Value=0x0) at menuitems.c:39
> 
> 
>>>>I suggest replacing that line with
>>>>  value = Value ? strdup(Value) : NULL;
>>>
>>>[snip]
>>>Full patch attached. On enabling the "set time from broadcast" function,
>>>default to the first available channel.
> 
> 
>>Hmmm... strdup() can return NULL if the system is low at or out of memory.
> 
> 
> True, but that probably doesn't matter here: something's going to fail anyway
> if that happens. Perhaps a wrapper is needed?

Memory is allocated and freed throughout the programm all the time.
I don't see how it could reasonably be made to cope with running out
of memory.

Back to the original problem.
I prefer this fix:


--- menuitems.c 2006/04/09 13:10:02     1.36
+++ menuitems.c 2006/04/10 06:31:02
@@ -572,7 +572,7 @@
       snprintf(buf, sizeof(buf), "%d %s", *value, channel ? channel->Name() : "");
       SetValue(buf);
       }
-  else
+  else if (noneString)
       SetValue(noneString);
  }


Klaus


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux