qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] i2c-ddc: fix oob read
@ 2019-01-08 10:23 Gerd Hoffmann
  2019-01-08 10:38 ` Michael Hanselmann
  2019-01-08 14:31 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2019-01-08 10:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: public, Gerd Hoffmann

Suggested-by: Michael Hanselmann <public@hansmi.ch>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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;
 }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-08 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-08 10:23 [Qemu-devel] [PATCH] i2c-ddc: fix oob read Gerd Hoffmann
2019-01-08 10:38 ` Michael Hanselmann
2019-01-08 14:31 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).