summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-30 14:32:10 -0400
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2012-08-19 08:41:37 -0700
commitaf8ffefc070be8cb449812100b86501db17e8fd8 (patch)
tree391304db698eb7db5fec123acd5f2ffc0d62edad
parent3a2b67577cdf0d4e3aae28883e65cf782673198a (diff)
kinput: allocate enough space for null character.
This code wasn't allocating enough space and was assigning the NULL one past the end. Pointed out by coverity. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 531785dd746d64ef7f473a83ca73bb20e74b6fca)
-rw-r--r--hw/kdrive/src/kinput.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 692e511a8..eabee6d41 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1055,7 +1055,7 @@ KdGetOptions(InputOption **options, char *string)
if (strchr(string, '=')) {
tam_key = (strchr(string, '=') - string);
- key = strndup(string, tam_key);
+ key = strndup(string, tam_key + 1);
if (!key)
goto out;