From 531785dd746d64ef7f473a83ca73bb20e74b6fca Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 30 Jul 2012 14:32:10 -0400 Subject: [PATCH] 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 Reviewed-by: Adam Jackson Signed-off-by: Dave Airlie Signed-off-by: Keith Packard --- hw/kdrive/src/kinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;