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
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
12
gchar endbuf[21 * (G_ASCII_DTOSTR_BUF_SIZE + 1)];
23
+ snprintf (fmt_str, sizeof (fmt_str), "%%d %%d %%%lds", sizeof (endbuf) - 1);
29
t = &s.com.texture[i];
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
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];
51
style_entry->r = style_entry->g = style_entry->b = style_entry->a = 0.;
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);
59
ptr = strchr (text[n], ':');
62
if (!strcmp (tmpstr, name))
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
75
gchar buffer3[G_ASCII_DTOSTR_BUF_SIZE];
80
if (response_id == GTK_RESPONSE_OK)
82
@@ -1381,23 +1382,41 @@
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);
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);
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;
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);