qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] i2c-ddc: fix oob read


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] i2c-ddc: fix oob read
Date: Tue, 8 Jan 2019 15:31:05 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 1/8/19 11:23 AM, Gerd Hoffmann wrote:
> Suggested-by: Michael Hanselmann <address@hidden>
> Signed-off-by: Gerd Hoffmann <address@hidden>
> ---
>  hw/i2c/i2c-ddc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i2c/i2c-ddc.c b/hw/i2c/i2c-ddc.c
> index be34fe072c..0a0367ff38 100644
> --- a/hw/i2c/i2c-ddc.c
> +++ b/hw/i2c/i2c-ddc.c
> @@ -56,7 +56,7 @@ static int i2c_ddc_rx(I2CSlave *i2c)
>      I2CDDCState *s = I2CDDC(i2c);
>  
>      int value;
> -    value = s->edid_blob[s->reg];
> +    value = s->edid_blob[s->reg % sizeof(s->edid_blob)];
>      s->reg++;
>      return value;
>  }
> 

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]