diff --git a/lib/src/ca.c b/lib/src/ca.c index 9c38caa..72f2a31 100644 --- a/lib/src/ca.c +++ b/lib/src/ca.c @@ -631,6 +631,9 @@ static int init_ca(struct dddvb *dd, int a, int f, int fd) struct dddvb_ca *ca; char fname[80]; + if (dd->dvbca_num >= DDDVB_MAX_DVB_CA) + return -1; + ca = &dd->dvbca[dd->dvbca_num]; ca->dd = dd; ca->anum = a; diff --git a/lib/src/dvb.c b/lib/src/dvb.c index b639078..a7b9586 100644 --- a/lib/src/dvb.c +++ b/lib/src/dvb.c @@ -798,6 +798,9 @@ static int dddvb_fe_init(struct dddvb *dd, int a, int f, int fd) int r; uint32_t i, ds; + if (dd->dvbfe_num >= DDDVB_MAX_DVB_FE) + return -1; + fe = &dd->dvbfe[dd->dvbfe_num]; r = snprintf(fe->name, sizeof(fe->name), "/dev/dvb/adapter%d/frontend%d", a, f);