From 02313d506f360392a6e221a31a267f0aa79c0dfb Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Wed, 11 Apr 2012 13:43:50 +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 0ae209eca..c7ad10e27 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -1455,9 +1455,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