projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c866e0b
)
glsl/blob: Return false from ensure_can_read on overrun
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Wed, 11 Oct 2017 17:56:48 +0000
(10:56 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Fri, 13 Oct 2017 04:47:06 +0000
(21:47 -0700)
Otherwise, if you have a large read fail and then try to do a small
read, the small read may succeed even though it's at the wrong offset.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable@lists.freedesktop.org
src/compiler/glsl/blob.c
patch
|
blob
|
history
diff --git
a/src/compiler/glsl/blob.c
b/src/compiler/glsl/blob.c
index 3c4aed8524d41ed8e1353d3d7839817fc77dd3f2..e837cdf2a0b69675bed27634fcdcdc8de87a96b2 100644
(file)
--- a/
src/compiler/glsl/blob.c
+++ b/
src/compiler/glsl/blob.c
@@
-207,6
+207,9
@@
blob_reader_init(struct blob_reader *blob, uint8_t *data, size_t size)
static bool
ensure_can_read(struct blob_reader *blob, size_t size)
{
+ if (blob->overrun)
+ return false;
+
if (blob->current < blob->end && blob->end - blob->current >= size)
return true;