Bug 87893

Summary: use of an uninitialized variable in error path
Product: cairo Reporter: Massimo <sixtysix>
Component: xlib backendAssignee: Arpit <jain.arpit>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Massimo 2014-12-31 07:20:30 UTC
in _cairo_xlib_font_fini

http://cgit.freedesktop.org/cairo/tree/src/cairo-xlib-render-compositor.c#n967

when _cairo_xlib_display_acquire does not return SUCCESS,
'display' is not initialized:

http://cgit.freedesktop.org/cairo/tree/src/cairo-xlib-display.c#n366

so after BAIL: it is better to use priv->device and not
&display->base

http://cgit.freedesktop.org/cairo/tree/src/cairo-xlib-render-compositor.c#n981
Comment 1 Arpit 2015-07-03 07:28:12 UTC
The patch for this Bug is submitted.
and the link for the patch is as follows:

http://lists.freedesktop.org/archives/cairo/2015-June/026337.html
Comment 2 Bryce Harrington 2015-07-06 21:30:41 UTC
Thanks, fix pushed:

commit f6843d5cbb79c35f7b331ac31c4a55c9574928fc
Author: Arpit Jain <jain.arpit@samsung.com>
Date:   Mon Jul 6 14:13:06 2015 -0700

    xlib: Fix deferencing of uninitialised 'display'

    Initialising 'display' to NULL and checking before deferencing during display->base.
    This patch will check the deferencing of uninitialised 'display' in case,
    _cairo_xlib_display_acquire does not return CAIRO_STATUS_SUCCESS.

    Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=87893
    Signed-off-by: Arpit Jain <jain.arpit@samsung.com>
    Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.