[PATCH:xf86-input-mouse] Avoid NULL pointer dereference in autoprobe if proto == PROT_UNSUP
Alexandr Shadchin
alexandr.shadchin at gmail.com
Sat Dec 3 08:11:14 PST 2011
On Wed, Nov 30, 2011 at 07:32:47PM -0800, Alan Coopersmith wrote:
> Error: Null pointer dereference (CWE 476)
> Read from null pointer 'GetProtocol(proto)'
> at line 3477 of driver/xf86-input-mouse/src/mouse.c in function 'autoProbeMouse'.
> Function 'GetProtocol' may return constant 'NULL' at line 736, called at line 3477.
> Null pointer introduced at line 736 in function 'GetProtocol'.
>
> We already handle one of the two cases that make GetProtocol return NULL,
> proto == PROTO_UNKNOWN, but not PROT_UNSUP.
>
> [ This bug was found by the Parfait 0.4.2 bug checking tool.
> For more information see http://labs.oracle.com/projects/parfait/ ]
>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Alexandr Shadchin <alexandr.shadchin at gmail.com>
--
Alexandr Shadchin
More information about the xorg-devel
mailing list