~ubuntu-branches/ubuntu/precise/pango1.0/precise-updates

« back to all changes in this revision

Viewing changes to debian/patches/01_CVE-2011-0020.patch

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-04-06 12:19:40 UTC
  • mfrom: (1.5.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110406121940-txe505g5c7ly32ig
Tags: 1.28.4-0ubuntu1
* New upstream release
* debian/control:
  - Bump depends on libglib2.0-dev
  - Add Vcs-Bzr link
* debian/patches/00git_gi_annotations.patch:
* debian/patches/01_CVE-2011-0020.patch:
* debian/patches/02_CVE-2011-0064.patch:
  - Applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
CVE-2011-0020
2
 
Debian #610792
3
 
Launchpad #696616
4
 
GNOME #639882
5
 
 
6
 
diff --git a/pango/pangoft2-render.c b/pango/pangoft2-render.c
7
 
index bd3b7d4..42923f4 100644
8
 
--- a/pango/pangoft2-render.c
9
 
+++ b/pango/pangoft2-render.c
10
 
@@ -121,9 +121,14 @@ pango_ft2_font_render_box_glyph (int      width,
11
 
 
12
 
   box->bitmap.width = width;
13
 
   box->bitmap.rows = height;
14
 
-  box->bitmap.pitch = height;
15
 
+  box->bitmap.pitch = width;
16
 
 
17
 
-  box->bitmap.buffer = g_malloc0 (box->bitmap.rows * box->bitmap.pitch);
18
 
+  box->bitmap.buffer = g_malloc0_n (box->bitmap.rows, box->bitmap.pitch);
19
 
+
20
 
+  if (G_UNLIKELY (!box->bitmap.buffer)) {
21
 
+    g_slice_free (PangoFT2RenderedGlyph, box);
22
 
+    return NULL;
23
 
+  }
24
 
 
25
 
   /* draw the box */
26
 
   for (j = 0; j < line_width; j++)
27
 
@@ -226,6 +231,11 @@ pango_ft2_font_render_glyph (PangoFont *font,
28
 
       rendered->bitmap_left = face->glyph->bitmap_left;
29
 
       rendered->bitmap_top = face->glyph->bitmap_top;
30
 
 
31
 
+      if (G_UNLIKELY (!rendered->bitmap.buffer)) {
32
 
+        g_slice_free (PangoFT2RenderedGlyph, rendered);
33
 
+       return NULL;
34
 
+      }
35
 
+
36
 
       return rendered;
37
 
     }
38
 
   else
39
 
@@ -276,6 +286,8 @@ pango_ft2_renderer_draw_glyph (PangoRenderer *renderer,
40
 
   if (rendered_glyph == NULL)
41
 
     {
42
 
       rendered_glyph = pango_ft2_font_render_glyph (font, glyph);
43
 
+      if (rendered_glyph == NULL)
44
 
+        return;
45
 
       add_glyph_to_cache = TRUE;
46
 
     }
47