~ubuntu-branches/ubuntu/utopic/gimp/utopic

« back to all changes in this revision

Viewing changes to debian/patches/05_CVE-2010-454x.patch

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2011-04-07 10:40:22 UTC
  • Revision ID: package-import@ubuntu.com-20110407104022-ka90cx60lwrf9ro7
Tags: 2.6.11-1ubuntu6
* SECURITY UPDATE: denial of service and possible code execution via
  malformed plugin configuration files
  - debian/patches/05_CVE-2010-454x.patch: fix format strings in
    plug-ins/{common/sphere-designer,gfig/gfig-style,
    lighting/lighting-ui}.c.
  - CVE-2010-4540
  - CVE-2010-4541
  - CVE-2010-4542
* SECURITY UPDATE: denial of service and possible code execution via
  malformed PSP image file
  - debian/patches/06_CVE-2010-4543.patch: fix buffer overflow in
    plug-ins/common/file-psp.c.
  - CVE-2010-4543

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: fix denial of service and possible code execution via
 
2
 malformed plugin configuration files
 
3
Origin: upstream, http://git.gnome.org/browse/gimp/commit/?id=7fb0300e1cfdb98a3bde54dbc73a0f3eda375162
 
4
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608497
 
5
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=639203
 
6
 
 
7
Index: gimp-2.6.11/plug-ins/common/sphere-designer.c
 
8
===================================================================
 
9
--- gimp-2.6.11.orig/plug-ins/common/sphere-designer.c  2011-04-07 10:39:20.396192480 -0400
 
10
+++ gimp-2.6.11/plug-ins/common/sphere-designer.c       2011-04-07 10:40:07.156192468 -0400
 
11
@@ -1992,6 +1992,7 @@
 
12
   gchar    endbuf[21 * (G_ASCII_DTOSTR_BUF_SIZE + 1)];
 
13
   gchar   *end = endbuf;
 
14
   gchar    line[1024];
 
15
+  gchar    fmt_str[16];
 
16
   gint     i;
 
17
   texture *t;
 
18
   gint     majtype, type;
 
19
@@ -2016,6 +2017,8 @@
 
20
 
 
21
   s.com.numtexture = 0;
 
22
 
 
23
+  snprintf (fmt_str, sizeof (fmt_str), "%%d %%d %%%lds", sizeof (endbuf) - 1);
 
24
+
 
25
   while (!feof (f))
 
26
     {
 
27
 
 
28
@@ -2026,7 +2029,7 @@
 
29
       t = &s.com.texture[i];
 
30
       setdefaults (t);
 
31
 
 
32
-      if (sscanf (line, "%d %d %s", &t->majtype, &t->type, end) != 3)
 
33
+      if (sscanf (line, fmt_str, &t->majtype, &t->type, end) != 3)
 
34
         t->color1.x = g_ascii_strtod (end, &end);
 
35
       if (end && errno != ERANGE)
 
36
         t->color1.y = g_ascii_strtod (end, &end);
 
37
Index: gimp-2.6.11/plug-ins/gfig/gfig-style.c
 
38
===================================================================
 
39
--- gimp-2.6.11.orig/plug-ins/gfig/gfig-style.c 2011-04-07 10:39:35.966192476 -0400
 
40
+++ gimp-2.6.11/plug-ins/gfig/gfig-style.c      2011-04-07 10:40:07.156192468 -0400
 
41
@@ -165,6 +165,7 @@
 
42
   gchar *ptr;
 
43
   gchar *tmpstr;
 
44
   gchar *endptr;
 
45
+  gchar  fmt_str[32];
 
46
   gchar  colorstr_r[G_ASCII_DTOSTR_BUF_SIZE];
 
47
   gchar  colorstr_g[G_ASCII_DTOSTR_BUF_SIZE];
 
48
   gchar  colorstr_b[G_ASCII_DTOSTR_BUF_SIZE];
 
49
@@ -172,6 +173,10 @@
 
50
 
 
51
   style_entry->r = style_entry->g = style_entry->b = style_entry->a = 0.;
 
52
 
 
53
+  snprintf (fmt_str, sizeof (fmt_str), "%%%lds %%%lds %%%lds %%%lds",
 
54
+            sizeof (colorstr_r) - 1, sizeof (colorstr_g) - 1,
 
55
+            sizeof (colorstr_b) - 1, sizeof (colorstr_a) - 1);
 
56
+
 
57
   while (n < nitems)
 
58
     {
 
59
       ptr = strchr (text[n], ':');
 
60
@@ -181,7 +186,8 @@
 
61
           ptr++;
 
62
           if (!strcmp (tmpstr, name))
 
63
             {
 
64
-              sscanf (ptr, "%s %s %s %s", colorstr_r, colorstr_g, colorstr_b, colorstr_a);
 
65
+              sscanf (ptr, fmt_str,
 
66
+                      colorstr_r, colorstr_g, colorstr_b, colorstr_a);
 
67
               style_entry->r = g_ascii_strtod (colorstr_r, &endptr);
 
68
               style_entry->g = g_ascii_strtod (colorstr_g, &endptr);
 
69
               style_entry->b = g_ascii_strtod (colorstr_b, &endptr);
 
70
Index: gimp-2.6.11/plug-ins/lighting/lighting-ui.c
 
71
===================================================================
 
72
--- gimp-2.6.11.orig/plug-ins/lighting/lighting-ui.c    2011-04-07 10:39:44.816192474 -0400
 
73
+++ gimp-2.6.11/plug-ins/lighting/lighting-ui.c 2011-04-07 10:40:07.156192468 -0400
 
74
@@ -1342,6 +1342,7 @@
 
75
   gchar          buffer3[G_ASCII_DTOSTR_BUF_SIZE];
 
76
   gchar          type_label[21];
 
77
   gchar         *endptr;
 
78
+  gchar          fmt_str[32];
 
79
 
 
80
   if (response_id == GTK_RESPONSE_OK)
 
81
     {
 
82
@@ -1381,23 +1382,41 @@
 
83
                   return;
 
84
                 }
 
85
 
 
86
-              fscanf (fp, " Position: %s %s %s", buffer1, buffer2, buffer3);
 
87
+              snprintf (fmt_str, sizeof (fmt_str),
 
88
+                        " Position: %%%lds %%%lds %%%lds",
 
89
+                        sizeof (buffer1) - 1,
 
90
+                        sizeof (buffer2) - 1,
 
91
+                        sizeof (buffer3) - 1);
 
92
+              fscanf (fp, fmt_str, buffer1, buffer2, buffer3);
 
93
               source->position.x = g_ascii_strtod (buffer1, &endptr);
 
94
               source->position.y = g_ascii_strtod (buffer2, &endptr);
 
95
               source->position.z = g_ascii_strtod (buffer3, &endptr);
 
96
 
 
97
-              fscanf (fp, " Direction: %s %s %s", buffer1, buffer2, buffer3);
 
98
+              snprintf (fmt_str, sizeof (fmt_str),
 
99
+                        " Direction: %%%lds %%%lds %%%lds",
 
100
+                        sizeof (buffer1) - 1,
 
101
+                        sizeof (buffer2) - 1,
 
102
+                        sizeof (buffer3) - 1);
 
103
+              fscanf (fp, fmt_str, buffer1, buffer2, buffer3);
 
104
               source->direction.x = g_ascii_strtod (buffer1, &endptr);
 
105
               source->direction.y = g_ascii_strtod (buffer2, &endptr);
 
106
               source->direction.z = g_ascii_strtod (buffer3, &endptr);
 
107
 
 
108
-              fscanf (fp, " Color: %s %s %s", buffer1, buffer2, buffer3);
 
109
+              snprintf (fmt_str, sizeof (fmt_str),
 
110
+                        " Color: %%%lds %%%lds %%%lds",
 
111
+                        sizeof (buffer1) - 1,
 
112
+                        sizeof (buffer2) - 1,
 
113
+                        sizeof (buffer3) - 1);
 
114
+              fscanf (fp, fmt_str, buffer1, buffer2, buffer3);
 
115
               source->color.r = g_ascii_strtod (buffer1, &endptr);
 
116
               source->color.g = g_ascii_strtod (buffer2, &endptr);
 
117
               source->color.b = g_ascii_strtod (buffer3, &endptr);
 
118
               source->color.a = 1.0;
 
119
 
 
120
-              fscanf (fp, " Intensity: %s", buffer1);
 
121
+              snprintf (fmt_str, sizeof (fmt_str),
 
122
+                        " Intensity: %%%lds",
 
123
+                        sizeof (buffer1) - 1);
 
124
+              fscanf (fp, fmt_str, buffer1);
 
125
               source->intensity = g_ascii_strtod (buffer1, &endptr);
 
126
 
 
127
             }