mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 22:20:09 +01:00
main: fix coverity error in _mesa_program_resource_find_name()
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>
This commit is contained in:
parent
f2f1277624
commit
39c1892dd8
1 changed files with 4 additions and 1 deletions
|
|
@ -581,8 +581,11 @@ _mesa_program_resource_find_name(struct gl_shader_program *shProg,
|
|||
{
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue