Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11389
-gerrit
commit 208d840e531e88cb52b30b8db5fca77951537488 Author: David Hendricks dhendrix@chromium.org Date: Thu Aug 13 15:51:00 2015 -0700
edid: Memset output earlier in decode_edid()
This ensures the output buffer is initialized before exiting decode_edid() so that if the return value is ignored in higher-level logic (like when dealing with external displays) we don't leave the struct filled with garbage.
BUG=chrome-os-partner:42946 BRANCH=firmware-veyron TEST=none
Change-Id: I557e2495157458342db6d8b0b1ecb39f7267f61f Signed-off-by: Patrick Georgi patrick@georgi-clan.de Original-Commit-Id: bb12dca133576543efa4d3bcc9aadf85d37c8b71 Original-Change-Id: I697436fffadc7dd3af239436061975165a97ec8c Original-Signed-off-by: David Hendricks dhendrix@chromium.org Original-Reviewed-on: https://chromium-review.googlesource.com/293547 Original-Reviewed-by: Julius Werner jwerner@chromium.org --- src/lib/edid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lib/edid.c b/src/lib/edid.c index 22f3f0e..ed3565c 100644 --- a/src/lib/edid.c +++ b/src/lib/edid.c @@ -1001,12 +1001,13 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
dump_breakdown(edid);
+ memset(out, 0, sizeof(*out)); + if (!edid || memcmp(edid, "\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00", 8)) { printk(BIOS_SPEW, "No header found\n"); return 1; }
- memset(out, 0, sizeof(*out)); if (manufacturer_name(edid + 0x08)) c.manufacturer_name_well_formed = 1;