summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-30 14:32:10 -0400
committerKeith Packard <keithp@keithp.com>2012-08-06 15:03:47 -0700
commit531785dd746d64ef7f473a83ca73bb20e74b6fca (patch)
treeed8a1c7f263894acbdc3fc99e483d55c72b8ee98
parent8843aed82e7d69422e7763a35832a2be8f26723f (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>
-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 b1068bbee..d35dcf848 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1034,7 +1034,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;