From: Frank Mori Hess Date: Tue, 8 Aug 2006 14:40:26 +0000 (+0000) Subject: Added length checks for data array of INSN_CONFIG_ALT_SOURCE and X-Git-Tag: r0_7_72~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6a4812af56bea755b5e13bd877483a3df657d1a4;p=comedi.git Added length checks for data array of INSN_CONFIG_ALT_SOURCE and INSN_CONFIG_PWM_OUTPUT --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 69c556d9..33afcebd 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -520,7 +520,7 @@ static int do_bufinfo_ioctl(comedi_device *dev,void *arg) bi.buf_read_ptr = async->buf_read_ptr; if(s==dev->read_subdev){ unsigned int n_munge_bytes; - + n_munge_bytes = bi.buf_write_count - s->async->munge_count; comedi_buf_munge(dev, s, n_munge_bytes); } @@ -636,8 +636,12 @@ static int check_insn_config_length(comedi_insn *insn, lsampl_t *data) case INSN_CONFIG_SERIAL_CLOCK: case INSN_CONFIG_BIDIRECTIONAL_DATA: case INSN_CONFIG_SET_RTSI_CLOCK_MODE: + case INSN_CONFIG_ALT_SOURCE: if( insn->n == 2 ) return 0; break; + case INSN_CONFIG_PWM_OUTPUT: + if(insn->n == 5) return 0; + break; //by default we allow the insn since we don't have checks for all possible cases yet default: rt_printk("comedi: no check for data length of config insn id %i implemented. Assuming n=%i is correct.\n",