text: init the target buffer to zero There's a (theoretical?) path where we might end up strcpy() buf without ever writing to it. This happens if the mask is nonzero but specifies a modifier larger than the one in the xkb_mod_set. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/src/text.c b/src/text.c
index 462d919..ec8bdf8 100644
--- a/src/text.c
+++ b/src/text.c
@@ -254,7 +254,7 @@ const char *
ModMaskText(struct xkb_context *ctx, const struct xkb_mod_set *mods,
xkb_mod_mask_t mask)
{
- char buf[1024];
+ char buf[1024] = {0};
size_t pos = 0;
xkb_mod_index_t i;
const struct xkb_mod *mod;