[mythtv] Re: [mythtv-commits] mythtv commits

Kenneth Aafl°y lists at kenneth.aafloy.net
Sat Oct 23 18:38:32 UTC 2004

On Saturday 23 October 2004 19:44, Holger Buchfink wrote:
> Kenneth Aafl°y wrote:
> > I wasn't talking about a overflow, but that is something that also can go
> > wrong in the future, but I doubt stars will overflow right now. The check
> > for the end of the doubly linked list however, can wrap in
> > fromstringlist, which will cause a ~infinite deadlock in fromscheduler. I
> > have not checked if this might occur at other places in programinfo. A
> > check for a null string on conversion to ascii would be nice too.
> You were however, talking about it being related to the changes made,
> the check for end of list wasn't part of the changes, been there long
> before.

Ups, sorry, should have looked a bit closer :(

> It is indeed a problem, I guess the only way to handle it would 
> be to check for a valid iterator before a list element is read. I'll
> take a shot at it and throw in some null checking in both
> To/FromStringList().

I guess a loop that checks every iterator NUMPROGRAMLINES forward for a end() 
iterator before the parsing takes place will do just fine. In the hope that 
you didn't start making this patch yet, I've attached my patch. I've changed 
the atoi/atof to toInt/toFloat as the former is very fragile to invalid data, 
but the latter are a lot slower (was this the main speed gain?). Anyways, if 
this get's in the parsing won't even be done if the itemcount doesn't line 
up, so atoi/atof is probably safe.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: programinfo.patch
Type: text/x-diff
Size: 1470 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20041023/54e66acc/programinfo.bin

More information about the mythtv-dev mailing list