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:
parent
8843aed82e
commit
531785dd74
|
@ -1034,7 +1034,7 @@ KdGetOptions(InputOption **options, char *string)
|
||||||
|
|
||||||
if (strchr(string, '=')) {
|
if (strchr(string, '=')) {
|
||||||
tam_key = (strchr(string, '=') - string);
|
tam_key = (strchr(string, '=') - string);
|
||||||
key = strndup(string, tam_key);
|
key = strndup(string, tam_key + 1);
|
||||||
if (!key)
|
if (!key)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user