We did not take into account if name is NULL, so we could dereference
a NULL pointer in strncmp() call.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
{
struct gl_program_resource *res = NULL;
+ if (name == NULL)
+ return NULL;
+
/* If we have a name, try the ProgramResourceHash first. */
- if (name && shProg->data->ProgramResourceHash)
+ if (shProg->data->ProgramResourceHash)
res = search_resource_hash(shProg, programInterface, name, array_index);
if (res)