提交 fefe228c 编写于 作者: D Dan Carpenter 提交者: Takashi Iwai

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 88d57606
...@@ -205,7 +205,7 @@ static int vx_read_status(struct vx_core *chip, struct vx_rmh *rmh) ...@@ -205,7 +205,7 @@ static int vx_read_status(struct vx_core *chip, struct vx_rmh *rmh)
if (size < 1) if (size < 1)
return 0; return 0;
if (snd_BUG_ON(size > SIZE_MAX_STATUS)) if (snd_BUG_ON(size >= SIZE_MAX_STATUS))
return -EINVAL; return -EINVAL;
for (i = 1; i <= size; i++) { for (i = 1; i <= size; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册