[mythtv] [mythtv-commits] Ticket #1482: add some validation for sections readed by dvbsiparser

Janne Grunau janne-mythtv at grunau.be
Fri Mar 10 21:28:11 UTC 2006


On Friday 10 March 2006 10:17, MythTV wrote:
> #1482: add some validation for sections readed by dvbsiparser

> Comment:
>
>  In the case where we get 0 - 7 bytes, we should be
>  doing further reads into the buffer starting at the end of
>  the previous read. So something like

I wasn't sure how to handle too small packet. But i thought after a 
little skimming through the DVB-API, that a read should return a whole 
section. So if the section in the buffer is invalid it's an error and 
the must dispose the section.
Please correct me me if I wrong.

>  I also think we should be doing that if the whole packet
>  is incomplete. So when we get enough data for the header
>  we can check the header length to find out the packet size
>  and not attempt to parse it till we have sufficient data
>  for a complete packet.

If my previous statement is correct, this is also not possible. But it 
might be a good idea to check if the buffer is at least 3 bytes. Then 
read the section_length and compare it to the buffer size. Process the 
section only if the match. I'll update the patch in the ticket later.

ciao Janne


More information about the mythtv-dev mailing list