From: Dave Airlie <[email protected]>

This code wasn't allocating enough space and was assigning the NULL
one past the end.

Pointed out by coverity.

Reviewed-by: Jeremy Huddleston <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
---
 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 b1068bb..d35dcf8 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;
 
-- 
1.7.7.6

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to