Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: vx_core: off by one in vx_read_status()

This code is older than git, and I haven't tested it, but if size ==
SIZE_MAX_STATUS then we would write one space past the end of the
rmh->Stat[] array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Dan Carpenter and committed by
Takashi Iwai
fefe228c 88d57606

+1 -1
+1 -1
sound/drivers/vx/vx_core.c
··· 205 205 206 206 if (size < 1) 207 207 return 0; 208 - if (snd_BUG_ON(size > SIZE_MAX_STATUS)) 208 + if (snd_BUG_ON(size >= SIZE_MAX_STATUS)) 209 209 return -EINVAL; 210 210 211 211 for (i = 1; i <= size; i++) {