Skip to content

Commit

Permalink
Staging: comedi: s626: Possible read buffer overflow fix
Browse files Browse the repository at this point in the history
If `cmd->chanlist_len' is 0, then we write ppl[-1].

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Roel Kluin authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 88a28c8 commit 4ff863b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/comedi/drivers/s626.c
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,8 @@ static int s626_ai_load_polllist(uint8_t * ppl, struct comedi_cmd *cmd)
else
ppl[n] = (CR_CHAN((cmd->chanlist)[n])) | (RANGE_10V);
}
ppl[n - 1] |= EOPL;
if (n != 0)
ppl[n - 1] |= EOPL;

return n;
}
Expand Down

0 comments on commit 4ff863b

Please sign in to comment.