summaryrefslogtreecommitdiff
path: root/src/xkbcomp/action.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-08-01 18:47:24 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-08-01 18:50:38 +1000
commitc81682975d46030365da4e6c529f547a71014cee (patch)
tree493e67f05c5eced6bceb1d2c138a5adaac2e55b5 /src/xkbcomp/action.c
parentc1e5ac16e77a21f87bdf3bc4dea61b037a17dddb (diff)
downloadxorg-lib-libxkbcommon-c81682975d46030365da4e6c529f547a71014cee.tar.gz
action: make a note that we may not null-terminate private strings
Coverity complains that a 7-byte string may not be null-terminated when copied into act->data (size 7). This is fine, make a note of it. All the strings in xkeyboard-config only use 6 bytes + null terminator so this won't be an issue. The server (the only user of these) uses an 8-byte array and forcibly null-terminates the string, see XkbDDXPrivate(). Everything else treats it as byte-array size 7 anyway so whether it's null-terminated doesn't matter. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/xkbcomp/action.c')
-rw-r--r--src/xkbcomp/action.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 5f1fd65..f99a850 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -705,6 +705,7 @@ HandlePrivate(struct xkb_context *ctx, const struct xkb_mod_set *mods,
return false;
}
+ /* act->data may not be null-terminated, this is intentional */
strncpy((char *) act->data, str, sizeof(act->data));
return true;
}