Opened 20 years ago

Closed 20 years ago

Last modified 20 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@…> 20 years ago.
20060310_athenas.gdb.txt (6.0 KB ) - added by Janne <janne-mythtv@…> 20 years ago.
sectionreader_validation2.patch (1023 bytes ) - added by Janne <janne-mythtv@…> 20 years ago.

Download all attachments as: .zip

Change History (8)

by Janne <janne-mythtv@…>, 20 years ago

comment:1 by Janne <janne-mythtv@…>, 20 years ago

one segfault, seems to be unrelated. backtrace attached

by Janne <janne-mythtv@…>, 20 years ago

Attachment: 20060310_athenas.gdb.txt added

comment:2 by Stuart Auchterlonie, 20 years ago

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.

by Janne <janne-mythtv@…>, 20 years ago

comment:3 by Janne <janne-mythtv@…>, 20 years ago

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

comment:4 by danielk, 20 years ago

Resolution: fixed
Status: newclosed

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

comment:5 by danielk, 20 years ago

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

Note: See TracTickets for help on using tickets.