summaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-07-23 11:17:17 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-08-01 13:50:38 +1000
commit9045b035981e4273ddbb64bfb31577bbf92d8597 (patch)
tree1739cc640ecf555e3e18990099fc485b29e02ae8 /src/text.c
parent842e4351c2c97de6051cab6ce36b4a81e709a0e1 (diff)
downloadxorg-lib-libxkbcommon-9045b035981e4273ddbb64bfb31577bbf92d8597.tar.gz
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>
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c2
1 files changed, 1 insertions, 1 deletions
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;