mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 00:43:08 -04:00
Staging: comedi: s626: Possible read buffer overflow fix
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
88a28c828f
commit
4ff863b1db
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user