From f75e0c5efc1fcedf4312acedd4e36fd7f5314127 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 26 Apr 2012 13:58:54 +0300 Subject: Check read() return value --- src/input/input_dvb.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 9077c221b..3ed2eea7f 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -1469,9 +1469,17 @@ static void load_epg_data(dvb_input_plugin_t *this) return; } n = read(this->tuner->fd_pidfilter[EITFILTER], eit, 3); + if (n != 3) { + xprintf(this->stream->xine,XINE_VERBOSITY_LOG,"Error reading EPG section length\n"); + break; + } table_id = getbits(eit, 0, 8); section_len = (unsigned int)getbits(eit, 12, 12); n = read(this->tuner->fd_pidfilter[EITFILTER], eit + 3, section_len); + if (n != section_len) { + xprintf(this->stream->xine,XINE_VERBOSITY_LOG,"Error reading EPG section data\n"); + break; + } service_id = (unsigned int)getbits(eit, 24, 16); -- cgit v1.2.3