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 <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37903>
This commit is contained in:
Erik Faye-Lund 2025-10-15 09:55:58 +02:00 committed by Marge Bot
parent 8147108590
commit 9839db709a

View file

@ -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;