summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-06 19:17:49 +0200
committerAndres Gomez <agomez@igalia.com>2017-06-28 20:17:13 +0300
commit8d5debbcc64b5e31d9f39b1a4de73f1df6f86eb1 (patch)
tree4f94a7097500e3e3127ca66123db7e27f71985db
parentc2ed6935015655fa21772284a9998b918e406f04 (diff)
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 <marek.olsak@amd.com> (cherry picked from commit 67e49a7f6570b8691d9405cb65f263b87817fe71)
-rw-r--r--src/amd/common/sid_tables.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/common/sid_tables.py b/src/amd/common/sid_tables.py
index fd88d3c9d5d..0a2b7ef1fe4 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' % (