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>
This commit is contained in:
Dave Airlie 2012-07-30 14:32:10 -04:00 committed by Keith Packard
parent 8843aed82e
commit 531785dd74

View File

@ -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;