1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

check FE/CA array size upon init

This commit is contained in:
Stefan Pöschel 2022-12-16 11:34:39 +01:00
parent 6bb5bcac05
commit e9b2e0e718
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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);