name string is coming through API call, need to be careful with it.

Signed-off-by: Juha-Pekka Heikkila <[email protected]>
---
 src/mesa/main/program_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
index b15a132..2891827 100644
--- a/src/mesa/main/program_resource.c
+++ b/src/mesa/main/program_resource.c
@@ -316,7 +316,7 @@ invalid_array_element_syntax(const GLchar *name)
    char *first = strchr(name, '[');
    char *last = strrchr(name, '[');
 
-   if (!first)
+   if (!first || !last)
       return false;
 
    /* No '+' or ' ' allowed anywhere. */
-- 
1.8.5.1

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to