Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1482 closed defect (fixed)

add some validation for sections readed by dvbsiparser

Reported by: Janne <janne-mythtv@…> Owned by: danielk
Priority: minor Milestone: 0.20
Component: dvb Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

attached patch is untested I'll report after a few hours of sleep

Attachments (3)

sectionreader_validation.patch (1.7 KB) - added by Janne <janne-mythtv@…> 13 years ago.
20060310_athenas.gdb.txt (6.0 KB) - added by Janne <janne-mythtv@…> 13 years ago.
sectionreader_validation2.patch (1023 bytes) - added by Janne <janne-mythtv@…> 13 years ago.

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by Janne <janne-mythtv@…>

comment:1 Changed 13 years ago by Janne <janne-mythtv@…>

one segfault, seems to be unrelated. backtrace attached

Changed 13 years ago by Janne <janne-mythtv@…>

Attachment: 20060310_athenas.gdb.txt added

comment:2 Changed 13 years ago by Stuart Auchterlonie

Milestone: 0.20
Version: head

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

if (rsz >0 && rsz < MIN_SIZE)
  partial packet.

if (partial packet)
    read (fd, &buffer[old_rsz+1], MAX_SIZE - old_rsz)

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.

Changed 13 years ago by Janne <janne-mythtv@…>

comment:3 Changed 13 years ago by Janne <janne-mythtv@…>

Updated patch, calls only ParseTable?() if the section_length matches the buffer length.

comment:4 Changed 13 years ago by danielk

Resolution: fixed
Status: newclosed

(In [9327]) Close #1482, add section read size validation by applying modified patch.

comment:5 Changed 13 years ago by danielk

(In [9338]) Fixes #1493, references #1482, by applying patch on #1493.

Note: See TracTickets for help on using tickets.