[Mesa-dev] [PATCH mesa] intel/eu/validate: avoid null deref

Matt Turner mattst88 at gmail.com
Mon Oct 23 17:33:17 UTC 2017


On Mon, Oct 23, 2017 at 10:08 AM, Eric Engestrom
<eric.engestrom at imgtec.com> wrote:
> src/intel/compiler/brw_eu_validate.c:50:11: warning: argument 1 null where non-null expected [-Wnonnull]
>     return memmem(haystack.str, haystack.len, needle.str, needle.len) != NULL;
>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from src/gallium/include/pipe/p_compiler.h:39:0,
>                  from src/gallium/auxiliary/util/u_math.h:42,
>                  from src/mesa/main/macros.h:35,
>                  from src/intel/compiler/brw_reg.h:47,
>                  from src/intel/compiler/brw_eu.h:39,
>                  from src/intel/compiler/brw_eu_validate.c:29:
> /usr/include/string.h:368:14: note: in a call to function ‘memmem’ declared here
>  extern void *memmem (const void *__haystack, size_t __haystacklen,
>               ^~~~~~
>
> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
> Looks to me like error_msg.str always starts off being NULL, so I would
> have expected this to have blown up already? I feel like I must be
> missing something here.

Thanks. Strange that I don't see this. Must require a newer gcc than
what I have.

I just reviewed Eric Anholt's similar patch to solve this problem, so
we can drop this one.


More information about the mesa-dev mailing list