freedreno: Add printf pattern string.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 4 Jun 2019 21:19:27 +0000 (23:19 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 4 Jun 2019 21:20:50 +0000 (23:20 +0200)
Some new flag setting disallows it due to being a security risk.

Fixes: c9c1e261064 "mesa: prevent common string formatting security issues"
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_screen.c

index 686a930f494f39682ef29c26aac7255be6ef4baa..12488ef90828cb499d3fdce0f218e120db2f2a47 100644 (file)
@@ -607,7 +607,7 @@ fd_get_compute_param(struct pipe_screen *pscreen, enum pipe_shader_ir ir_type,
 
        case PIPE_COMPUTE_CAP_IR_TARGET:
                if (ret)
-                       sprintf(ret, ir);
+                       sprintf(ret, "%s", ir);
                return strlen(ir) * sizeof(char);
 
        case PIPE_COMPUTE_CAP_GRID_DIMENSION: