1
0
mirror of https://github.com/ericonr/sndio.git synced 2024-02-18 04:45:21 -06:00

fix max ctl value check

This commit is contained in:
Alexandre Ratchov 2016-04-08 20:42:29 +02:00
parent ee10431307
commit ebefac2a1e

View File

@ -2117,8 +2117,15 @@ dev_setctl(struct dev *d, int addr, int val)
struct ctl *c;
int num;
if (val < 0 || val >= MIDI_MAXCTL)
if (val < 0 || val > MIDI_MAXCTL) {
if (log_level >= 3) {
dev_log(d);
log_puts(": ");
log_putu(val);
log_puts(": ctl val out of bounds\n");
}
return 0;
}
c = d->ctl_list;
for (;;) {
if (c == NULL) {