Bug 87893 - use of an uninitialized variable in error path
Summary: use of an uninitialized variable in error path
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: xlib backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Arpit
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-31 07:20 UTC by Massimo
Modified: 2015-07-06 21:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.