mesa: don't memcmp() off the end of a cache key.
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 31 Mar 2013 23:51:59 +0000 (12:51 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Sat, 6 Apr 2013 05:30:08 +0000 (18:30 +1300)
commitc4629ad3f9440ec7ad3d9f4881d0aba41a93f2f5
treeb232558c20a93b206a60ce7f3adf244b6333687b
parent302f53dc20593e72848f685643a34ea83d98bb65
mesa: don't memcmp() off the end of a cache key.

Reported-by: `per` in #intel-gfx
The size of the cache key varies, so store the actual size as well as
the key blob itself, rather than just assuming it's the same as the size
passed in.

NOTE: This is a candidate for stable branches.

V2: Don't leave silly holes in structure; use unsigned instead of GLuint.
V3: Fix missing case for `last` match.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/program/prog_cache.c