diff options
author | Dave Airlie <airlied@redhat.com> | 2012-07-30 14:32:10 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-08-06 15:03:47 -0700 |
commit | 531785dd746d64ef7f473a83ca73bb20e74b6fca (patch) | |
tree | ed8a1c7f263894acbdc3fc99e483d55c72b8ee98 | |
parent | 8843aed82e7d69422e7763a35832a2be8f26723f (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.c | 2 |
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; |