Skip to content

Commit

Permalink
ALSA: vx_core: off by one in vx_read_status()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Takashi Iwai committed Jun 21, 2013
1 parent 88d5760 commit fefe228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/drivers/vx/vx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit fefe228

Please sign in to comment.