[igt-dev] [PATCH i-g-t] lib/igt_edid: assert data blocks fit in CEA extension
Simon Ser
simon.ser at intel.com
Fri Jul 19 12:01:45 UTC 2019
This check could probably be more precise, but at least it checks we haven't
written past the EDID block end.
Signed-off-by: Simon Ser <simon.ser at intel.com>
---
lib/igt_edid.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/igt_edid.c b/lib/igt_edid.c
index dcc909bc63bb..1c85486df11b 100644
--- a/lib/igt_edid.c
+++ b/lib/igt_edid.c
@@ -472,6 +472,7 @@ void edid_ext_set_cea(struct edid_ext *ext, size_t data_blocks_size,
assert(num_native_dtds <= 0x0F);
assert((flags & 0x0F) == 0);
+ assert(data_blocks_size <= sizeof(cea->data));
cea->revision = 3;
cea->dtd_start = 4 + data_blocks_size;
cea->misc = flags | num_native_dtds;
--
2.22.0
More information about the igt-dev
mailing list