[Mesa-dev] [PATCH] mesa: do not use format string as literal string

Nicolai Hähnle nhaehnle at gmail.com
Wed Jun 28 12:53:41 UTC 2017


On 28.06.2017 13:54, Emil Velikov wrote:
> On 28 June 2017 at 12:46, Juan A. Suarez Romero <jasuarez at igalia.com> wrote:
>> This fixes a couple of  errors when building in Android:
>>
>> external/mesa3d/src/mesa/main/shaderapi.c:293:49: error: format string
>> is not a string literal (potentially insecure)
>> [-Werror,-Wformat-security]
>>           _mesa_error(ctx, GL_INVALID_OPERATION, caller);
>>                                                  ^~~~~~
>> external/mesa3d/src/mesa/main/shaderapi.c:293:49: note: treat the string
>> as an argument to avoid this
>>           _mesa_error(ctx, GL_INVALID_OPERATION, caller);
>>                                                  ^
> Have you tried annotating caller as "const char * const caller"? IIRC
> it was sufficient in some cases, although I'm not sure if it'll help
> here.

That would be really weird, since it has nothing to do with the security 
bug that this warning tries to warn against, which is heaving format 
specifiers in a user-supplied format string.

The patch is

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>


> 
> -Emil
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list