On Mon, Jan 27, 2014 at 08:07:15PM -0800, Vinson Lee wrote:
> This patch fixes this GCC warning.
>
> piglit-framework-cl-program.c: In function ‘piglit_cl_program_test_run’:
> piglit-framework-cl-program.c:218:3: warning: format not a string literal and
> no format arguments [-Wformat-security]
> sprintf(build_options+strlen(old), config->build_options);
> ^
>
> Signed-off-by: Vinson Lee <[email protected]>
Reviewed-by: Tom Stellard <[email protected]>
> ---
> tests/util/piglit-framework-cl-program.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/util/piglit-framework-cl-program.c
> b/tests/util/piglit-framework-cl-program.c
> index 417405d..374296f 100644
> --- a/tests/util/piglit-framework-cl-program.c
> +++ b/tests/util/piglit-framework-cl-program.c
> @@ -215,7 +215,7 @@ piglit_cl_program_test_run(const int argc,
> char* old = build_options;
> build_options = malloc((strlen(old) +
> strlen(config->build_options) + 1) * sizeof(char));
> strcpy(build_options, old);
> - sprintf(build_options+strlen(old), config->build_options);
> + sprintf(build_options+strlen(old), "%s", config->build_options);
> free(old);
> }
> if(version > 10) {
> --
> 1.8.3.2
>
> _______________________________________________
> Piglit mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/piglit
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit