From: Nicolai Hähnle Date: Tue, 6 Jun 2017 17:17:49 +0000 (+0200) Subject: amd/common: fix off-by-one in sid_tables.py X-Git-Tag: upstream/18.1.0~8677 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67e49a7f6570b8691d9405cb65f263b87817fe71;p=platform%2Fupstream%2Fmesa.git amd/common: fix off-by-one in sid_tables.py The very last entry in the sid_strings_offsets table ended up missing, leading to out-of-bounds reads and potential crashes. Reviewed-by: Marek Olšák --- diff --git a/src/amd/common/sid_tables.py b/src/amd/common/sid_tables.py index fd88d3c..0a2b7ef 100644 --- a/src/amd/common/sid_tables.py +++ b/src/amd/common/sid_tables.py @@ -110,7 +110,7 @@ class IntTable: [static] const typename name[] = { ... }; to filp. """ - idxs = sorted(self.idxs) + [-1] + idxs = sorted(self.idxs) + [len(self.table)] fragments = [ ('\t/* %s */ %s' % (