kdrive: check for null memory, fix OOB
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 25 Oct 2011 02:57:07 +0000 (12:57 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 25 Oct 2011 04:06:41 +0000 (14:06 +1000)
commita41214bc9a0f326c6dc129e4a6382efb8b826862
treebdef8ca2ac441e674cadabfd06ad457457bca981
parentffe20acedb3cdc4811eb52f8fc540ba6af7339fa
kdrive: check for null memory, fix OOB

If key/value allocation failed, don't bother adding another InputOption. And
make sure the memory allocated is large enough for the trailing \0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
hw/kdrive/src/kinput.c