[Mesa-dev] [PATCH 1/2] tgsi: fix out of bounds access

Rob Clark robdclark at gmail.com
Thu May 26 15:25:12 UTC 2016


From: Rob Clark <robclark at freedesktop.org>

Not sure why coverity calls this an out-of-bounds read vs out-of-bounds
write.

CID 1358920 (#1 of 1): Out-of-bounds read (OVERRUN)9. overrun-local:
Overrunning array r of 3 16-byte elements at element index 3 (byte
offset 48) using index chan (which evaluates to 3).

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/gallium/auxiliary/tgsi/tgsi_exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index d483429..6a5e5df 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -3850,7 +3850,7 @@ static void
 exec_load_mem(struct tgsi_exec_machine *mach,
               const struct tgsi_full_instruction *inst)
 {
-   union tgsi_exec_channel r[3];
+   union tgsi_exec_channel r[4];
    uint chan;
    char *ptr = mach->LocalMem;
    uint32_t offset;
-- 
2.5.5



More information about the mesa-dev mailing list