mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2025-03-01 10:35:23 +00:00
add range checks
This commit is contained in:
parent
ca9613d911
commit
3d17ab8de5
@ -631,6 +631,8 @@ 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;
|
||||
|
@ -799,6 +799,8 @@ static int dddvb_fe_init(struct dddvb *dd, int a, int f, int fd)
|
||||
int r;
|
||||
uint32_t i, ds;
|
||||
|
||||
if (dd->dvbca_num >= DDDVB_MAX_DVB_CA)
|
||||
return -1;
|
||||
fe = &dd->dvbfe[dd->dvbfe_num];
|
||||
|
||||
r = snprintf(fe->name, sizeof(fe->name), "/dev/dvb/adapter%d/frontend%d", a, f);
|
||||
|
Loading…
x
Reference in New Issue
Block a user