[Mesa-dev] [PATCH 01/16] glsl: check for leading zeros in array index validation

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Jul 21 01:01:46 PDT 2015


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On 18/07/15 03:25, Timothy Arceri wrote:
> ---
>  src/glsl/linker.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index b7a783c..cb679bd 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -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;
>  }
> 


More information about the mesa-dev mailing list