[cairo-bugs] [Bug 58061] Null pointer dereference in cairo_image_get_surface_data()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Sep 16 11:31:52 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=58061

--- Comment #4 from Bryce Harrington <b.harrington at samsung.com> ---
So, it sounds like the "fix" in this case is for gnucash to check the surface
is not NULL before using it in cairo calls.

Uli points out a few places where cairo does indeed return NULLs to the calling
user:

1. cairo_win32_surface_get_image, cairo_quartz_image_surface_get_image and
cairo_qt_surface_get_image do this to indicate errors if the surface type is
incorrect.  These are of type cairo_surface_t*.  We should be returning an
error surface via _cairo_surface_create_in_error() instead.

2. Similarly, in cairo_cogl_device_create, cairo_drm_device_get, and (probably)
cairo_drm_device_default, instead of returning NULL for the error cases the
routines should generate an error device via _cairo_device_create_in_error()
instead.

Somewhere in the documentation we may want to mention that passing in NULL
pointers for surface arguments is not kosher.  I'm not sure we'd want to litter
the API docs with "surface argument required; must be non-NULL".

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20140916/22abac45/attachment.html>


More information about the cairo-bugs mailing list