Commit 4ff863b1 authored by Roel Kluin's avatar Roel Kluin Committed by Greg Kroah-Hartman

Staging: comedi: s626: Possible read buffer overflow fix

If `cmd->chanlist_len' is 0, then we write ppl[-1].
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 88a28c82
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment