mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 03:48:06 +02:00
glsl: check for leading zeros in array index validation
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:
parent
7fccebf980
commit
09c440c718
1 changed files with 4 additions and 0 deletions
|
|
@ -462,6 +462,10 @@ parse_program_resource_name(const GLchar *name,
|
|||
if (array_index < 0)
|
||||
return -1;
|
||||
|
||||
/* Check for leading zero */
|
||||
if (name[i] == '0' && name[i+1] != ']')
|
||||
return -1;
|
||||
|
||||
*out_base_name_end = name + (i - 1);
|
||||
return array_index;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue