From 9839db709aecb2491239a6dae905fe367aa7df34 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 15 Oct 2025 09:55:58 +0200 Subject: [PATCH] panfrost: initialize sig before use If only invalid surfaces are passed, we end up using an undefined array as a string. And while this might not be possible, it is hard to reason about, especially for new readers and tools. So let's initialize the buffer as an empty string. CID: 1666581 Reviewed-by: Boris Brezillon Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: --- src/gallium/drivers/panfrost/pan_fb_preload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/panfrost/pan_fb_preload.c b/src/gallium/drivers/panfrost/pan_fb_preload.c index 85d47356285..321385fb8c5 100644 --- a/src/gallium/drivers/panfrost/pan_fb_preload.c +++ b/src/gallium/drivers/panfrost/pan_fb_preload.c @@ -406,6 +406,7 @@ pan_preload_get_shader(struct pan_fb_preload_cache *cache, unsigned coord_comps = 0; unsigned sig_offset = 0; char sig[256]; + sig[0] = '\0'; bool first = true; for (unsigned i = 0; i < ARRAY_SIZE(key->surfaces); i++) { const char *type_str, *dim_str;