[PATCH] kdrive: switch to new InputOption API.
Keith Packard
keithp at keithp.com
Mon Oct 24 19:05:53 PDT 2011
On Tue, 25 Oct 2011 11:41:57 +1000, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> tam_key = (strchr(string, '=') - string);
> - newopt->key = (char *)malloc(tam_key);
> - strncpy(newopt->key, string, tam_key);
> - newopt->key[tam_key] = '\0';
> - newopt->value = strdup(strchr(string, '=') + 1);
> + key = malloc(tam_key);
I realize the old code didn't check malloc returns, but it seems wrong
to leave bugs like that lying around. And, do we allow the use of
strndup in the server?
Otherwise, this patch is
Reviewed-by: Keith Packard <keithp at keithp.com>
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111024/20e8ef36/attachment.pgp>
More information about the xorg-devel
mailing list