From 3bdda4742423859a870a12c9df8a195a59931043 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 29 Nov 2013 00:12:47 -0200 Subject: [PATCH] libdvbv5/dvb-scan: all tables should have an specified size If a table has a zero size, reject it. Signed-off-by: Mauro Carvalho Chehab --- lib/libdvbv5/dvb-scan.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c index 639e669..e97ddfa 100644 --- a/lib/libdvbv5/dvb-scan.c +++ b/lib/libdvbv5/dvb-scan.c @@ -208,8 +208,13 @@ int dvb_read_section_with_id(struct dvb_v5_fe_parms *parms, int dmx_fd, if (!tbl) { if (dvb_table_initializers[tid].size) tbl = malloc(dvb_table_initializers[tid].size); - else - tbl = malloc(MAX_TABLE_SIZE); + else { + dvb_logerr("dvb_read_section: no table size for table %d", + tid); + free(buf); + dvb_dmx_stop(dmx_fd); + return -1; + } if (!tbl) { dvb_logerr("Out of memory"); free(buf); -- 2.7.4