From fa81698f01658685bd6deac31b28524f92166347 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Fri, 12 Apr 2024 10:19:59 -0400 Subject: [PATCH] c/main: fix snprintf output truncation Part-of: --- src/xrt/compositor/main/comp_compositor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c index 53d176cc7..ec2cfbb37 100644 --- a/src/xrt/compositor/main/comp_compositor.c +++ b/src/xrt/compositor/main/comp_compositor.c @@ -1101,7 +1101,7 @@ comp_main_create_system_compositor(struct xrt_device *xdev, // Only add active views. for (uint32_t i = 0; i < view_count; i++) { - char tmp[] = "View[X_XXX_XXX]"; + char tmp[64] = {0}; snprintf(tmp, sizeof(tmp), "View[%u]", i); u_var_add_native_images_debug(c, &c->scratch.views[i].unid, tmp); }