1From 054ad9b65e074899c82e75cfc6623cfe29ab1fea Mon Sep 17 00:00:00 2001
2From: Fan Xin <fan.xin@jp.fujitsu.com>
3Date: Tue, 6 Jun 2017 15:57:52 +0900
4Subject: [PATCH] Cairo: Fix Denial-of-Service Attack due to Logical Problem in
5 Program
6
7https://bugs.freedesktop.org/show_bug.cgi?id=100763
8
9CVE: CVE-2017-7475
10Upstream-Status: Submitted [https://gitlab.freedesktop.org/cairo/cairo/-/issues/80]
11
12Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
13---
14 src/cairo-ft-font.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
18index b5d08ee..5e20ae1 100644
19--- a/src/cairo-ft-font.c
20+++ b/src/cairo-ft-font.c
21@@ -1220,7 +1220,7 @@ _get_bitmap_surface (FT_Bitmap		     *bitmap,
22     width = bitmap->width;
23     height = bitmap->rows;
24
25-    if (width == 0 || height == 0) {
26+    if (width == 0 || height == 0 || bitmap->buffer == NULL) {
27 	*surface = (cairo_image_surface_t *)
28 	    cairo_image_surface_create_for_data (NULL, format, 0, 0, 0);
29 	return (*surface)->base.status;
30