diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2018-07-23 11:17:17 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2018-08-01 13:50:38 +1000 |
commit | 9045b035981e4273ddbb64bfb31577bbf92d8597 (patch) | |
tree | 1739cc640ecf555e3e18990099fc485b29e02ae8 /src/text.c | |
parent | 842e4351c2c97de6051cab6ce36b4a81e709a0e1 (diff) | |
download | xorg-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |