xlib: Fix double free in _get_image_surface() - from upstream

ok eric@ (maintainer)
This commit is contained in:
ajacoutot 2016-06-23 07:34:07 +00:00
parent ba9675a4ce
commit 6482af51e7
2 changed files with 35 additions and 8 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.61 2016/04/04 16:09:09 naddy Exp $
# $OpenBSD: Makefile,v 1.62 2016/06/23 07:34:07 ajacoutot Exp $
COMMENT= vector graphics library
DISTNAME= cairo-1.14.6
REVISION= 0
REVISION= 1
CATEGORIES= graphics
DPB_PROPERTIES= parallel
EXTRACT_SUFX= .tar.xz
@ -16,16 +17,14 @@ HOMEPAGE= http://cairographics.org/
MAINTAINER= Eric Faurot <eric@openbsd.org>
WANTLIB += X11 Xau Xdmcp Xext Xrender c expat ffi fontconfig freetype
WANTLIB += glib-2.0 gobject-2.0 lzo2 m pcre pixman-1 png pthread
WANTLIB += pthread-stubs xcb xcb-render xcb-shm z
# LGPLv2.1 / MPL 1.1
PERMIT_PACKAGE_CDROM= Yes
MASTER_SITES= http://cairographics.org/releases/
WANTLIB += X11 Xau Xdmcp Xext Xrender c expat ffi fontconfig freetype
WANTLIB += glib-2.0 gobject-2.0 iconv intl lzo2 m pcre pixman-1
WANTLIB += png pthread pthread-stubs xcb xcb-render xcb-shm z
MODULES= devel/gettext
MASTER_SITES= http://cairographics.org/releases/
USE_GMAKE= Yes
@ -35,6 +34,7 @@ LIB_DEPENDS= archivers/lzo2 \
CONFIGURE_STYLE= gnu
CONFIGURE_ENV= LDFLAGS=-L${LOCALBASE}/lib CFLAGS=-I${LOCALBASE}/include
CONFIGURE_ARGS= --disable-valgrind
# needed for firefox
CONFIGURE_ARGS += --enable-tee

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-src_cairo-xlib-surface_c,v 1.10 2016/06/23 07:34:07 ajacoutot Exp $
From d69dd6b341594c338fa6c7b327fd7f201eb37bc1 Mon Sep 17 00:00:00 2001
From: Uli Schlachter <psychon@znc.in>
Date: Sat, 18 Jun 2016 15:08:52 +0200
Subject: xlib: Fix double free in _get_image_surface()
--- src/cairo-xlib-surface.c.orig Tue Oct 27 22:04:30 2015
+++ src/cairo-xlib-surface.c Thu Jun 23 09:27:19 2016
@@ -807,6 +807,7 @@ _get_image_surface (cairo_xlib_surface_t *surface,
}
cairo_surface_destroy (&image->base);
+ image = NULL;
}
}
@@ -1011,7 +1012,8 @@ _get_image_surface (cairo_xlib_surface_t *surface,
cairo_device_release (&display->base);
if (unlikely (status)) {
- cairo_surface_destroy (&image->base);
+ if (image)
+ cairo_surface_destroy (&image->base);
return _cairo_surface_create_in_error (status);
}