i2c-ddc: fix oob read
Suggested-by: Michael Hanselmann <public@hansmi.ch> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190108102301.1957-1-kraxel@redhat.com
This commit is contained in:
parent
c2077ec2d9
commit
b05b267840
@ -56,7 +56,7 @@ static int i2c_ddc_rx(I2CSlave *i2c)
|
|||||||
I2CDDCState *s = I2CDDC(i2c);
|
I2CDDCState *s = I2CDDC(i2c);
|
||||||
|
|
||||||
int value;
|
int value;
|
||||||
value = s->edid_blob[s->reg];
|
value = s->edid_blob[s->reg % sizeof(s->edid_blob)];
|
||||||
s->reg++;
|
s->reg++;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user