[PATCH:libXcursor 2/2] XcursorImageLoadCursor: return failure if _XcursorGetDisplayInfo fails
Jeremy Huddleston
jeremyhu at apple.com
Tue Nov 29 23:31:19 PST 2011
Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
On Nov 28, 2011, at 9:10 PM, Alan Coopersmith wrote:
> Error: Null pointer dereference (CWE 476)
> Read from null pointer 'info'
> at line 615 of src/cursor.c in function 'XcursorImageLoadCursor'.
> Function '_XcursorGetDisplayInfo' may return constant 'NULL' at line 134, called at line 597.
> Null pointer introduced at line 134 of src/display.c in function '_XcursorGetDisplayInfo'.
>
> [ This bug was found by the Parfait 0.3.7 bug checking tool.
> For more information see http://labs.oracle.com/projects/parfait/ ]
>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> src/cursor.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/src/cursor.c b/src/cursor.c
> index b36339b..92bd417 100644
> --- a/src/cursor.c
> +++ b/src/cursor.c
> @@ -601,6 +601,9 @@ XcursorImageLoadCursor (Display *dpy, const XcursorImage *image)
> GC gc;
> XGCValues gcv;
>
> + if (!info)
> + return 0;
> +
> core.src_image = XCreateImage (dpy, NULL, 1, ZPixmap,
> 0, NULL, image->width, image->height,
> 32, 0);
> --
> 1.7.3.2
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list