Re: [alsa-devel] [patch] ASoC: rcar: off by one in rsnd_scu_set_route()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

> If "id == ARRAY_SIZE(routes)" then we read one space beyond the end of
> the routes[] array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
> index 1ab1bce..5e46ef2 100644
> --- a/sound/soc/sh/rcar/scu.c
> +++ b/sound/soc/sh/rcar/scu.c

Nice catch
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

> @@ -68,7 +68,7 @@ static int rsnd_scu_set_route(struct rsnd_priv *priv,
>  		return 0;
>  
>  	id = rsnd_mod_id(mod);
> -	if (id < 0 || id > ARRAY_SIZE(routes))
> +	if (id < 0 || id >= ARRAY_SIZE(routes))
>  		return -EIO;
>  
>  	/*
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@xxxxxxxxxxxxxxxx
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux