mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-15 22:08:17 +02:00
glsl/blob: Return false from ensure_can_read on overrun
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
(cherry picked from commit 7118851374)
This commit is contained in:
parent
d56aa9fe43
commit
4d1ae3283c
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue