From: Dan Carpenter Date: Fri, 21 Jun 2013 12:25:33 +0000 (+0300) Subject: ALSA: vx_core: off by one in vx_read_status() X-Git-Tag: v5.15~19714^2~7^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fefe228c5f13809f77e6b2873ffe8bfb006cadd4;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Takashi Iwai --- diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index c39961c..8359689 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -205,7 +205,7 @@ static int vx_read_status(struct vx_core *chip, struct vx_rmh *rmh) if (size < 1) return 0; - if (snd_BUG_ON(size > SIZE_MAX_STATUS)) + if (snd_BUG_ON(size >= SIZE_MAX_STATUS)) return -EINVAL; for (i = 1; i <= size; i++) {