1 from https://extensions.gnome.org/about/#old-version:
2 browser-plugin: Set that we need XEmbed
3 browser-plugin: Use g_strndup to get a string property
4 browser-plugin: Make sure to use the UTF8Length parameter
5 browser-plugin: Fix memory leak when passing an invalid UUID
7 From 2c2729f7be6ff4d8946c51ff8b59187fe38052d1 Mon Sep 17 00:00:00 2001
8 From: Jasper St. Pierre <jstpierre@mecheye.net>
9 Date: Fri, 11 Nov 2011 03:35:41 +0000
10 Subject: browser-plugin: Set that we need XEmbed
12 This makes the plugin work under WebKit-based browsers such as Chromium and
13 Epiphany. See http://code.google.com/p/chromium/issues/detail?id=38229 and
14 WindowedCreatePlugin() in
15 http://src.chromium.org/viewvc/chrome/trunk/src/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc?revision=86823&content-type=text%2Fplain
18 https://bugzilla.gnome.org/show_bug.cgi?id=663823
20 diff --git a/browser-plugin/browser-plugin.c b/browser-plugin/browser-plugin.c
21 index 0ab2d78..2daa0dd 100644
22 --- a/browser-plugin/browser-plugin.c
23 +++ b/browser-plugin/browser-plugin.c
24 @@ -816,6 +816,11 @@ NPP_GetValue(NPP instance,
26 *(NPObject**)value = funcs.createobject (instance, &plugin_class);
29 + case NPPVpluginNeedsXEmbed:
30 + *(bool *)value = TRUE;
38 From 9bc1a68fe48a0b1e8f377597387baea7a90a3a5b Mon Sep 17 00:00:00 2001
39 From: Jasper St. Pierre <jstpierre@mecheye.net>
40 Date: Fri, 11 Nov 2011 04:57:39 +0000
41 Subject: browser-plugin: Use g_strndup to get a string property
43 WebKit-based browsers like Chromium and Epiphany may insert extra junk at the
44 end of NPStrings, so we cannot depend on the strlen matching.
46 https://bugzilla.gnome.org/show_bug.cgi?id=663823
48 diff --git a/browser-plugin/browser-plugin.c b/browser-plugin/browser-plugin.c
49 index 2daa0dd..b717889 100644
50 --- a/browser-plugin/browser-plugin.c
51 +++ b/browser-plugin/browser-plugin.c
52 @@ -71,10 +71,7 @@ get_string_property (NPP instance,
55 result_str = NPVARIANT_TO_STRING (result);
56 - if (strlen (result_str.UTF8Characters) != result_str.UTF8Length)
59 - result_copy = g_strdup (result_str.UTF8Characters);
60 + result_copy = g_strndup (result_str.UTF8Characters, result_str.UTF8Length);
63 funcs.releasevariantvalue (&result);
66 From ab6a7773ce0bf0b6614fe81acc26521739723853 Mon Sep 17 00:00:00 2001
67 From: Jasper St. Pierre <jstpierre@mecheye.net>
68 Date: Thu, 17 Nov 2011 04:47:35 +0000
69 Subject: browser-plugin: Make sure to use the UTF8Length parameter
71 Some plugin hosts may have junk after the UTF8Characters that we need to strip
72 off. No current browsers that I know of do this, but it still helps to be
75 diff --git a/browser-plugin/browser-plugin.c b/browser-plugin/browser-plugin.c
76 index 385550c..e9f9950 100644
77 --- a/browser-plugin/browser-plugin.c
78 +++ b/browser-plugin/browser-plugin.c
79 @@ -455,7 +455,7 @@ plugin_enable_extension (PluginObject *obj,
83 - const gchar *uuid_str = uuid.UTF8Characters;
84 + gchar *uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
85 if (!uuid_is_valid (uuid_str))
88 @@ -468,6 +468,8 @@ plugin_enable_extension (PluginObject *obj,
90 NULL /* user_data */);
97 @@ -476,7 +478,7 @@ plugin_install_extension (PluginObject *obj,
101 - const gchar *uuid_str = uuid.UTF8Characters;
102 + gchar *uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
103 if (!uuid_is_valid (uuid_str))
106 @@ -491,6 +493,8 @@ plugin_install_extension (PluginObject *obj,
108 NULL /* user_data */);
115 @@ -501,9 +505,9 @@ plugin_uninstall_extension (PluginObject *obj,
117 GError *error = NULL;
119 - const gchar *uuid_str;
122 - uuid_str = uuid.UTF8Characters;
123 + uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
124 if (!uuid_is_valid (uuid_str))
127 @@ -516,6 +520,8 @@ plugin_uninstall_extension (PluginObject *obj,
128 NULL, /* cancellable */
135 g_warning ("Failed to uninstall extension: %s", error->message);
136 @@ -533,9 +539,9 @@ plugin_get_info (PluginObject *obj,
138 GError *error = NULL;
140 - const gchar *uuid_str;
143 - uuid_str = uuid.UTF8Characters;
144 + uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
145 if (!uuid_is_valid (uuid_str))
148 @@ -547,6 +553,8 @@ plugin_get_info (PluginObject *obj,
149 NULL, /* cancellable */
156 g_warning ("Failed to retrieve extension metadata: %s", error->message);
157 @@ -564,9 +572,9 @@ plugin_get_errors (PluginObject *obj,
159 GError *error = NULL;
161 - const gchar *uuid_str;
164 - uuid_str = uuid.UTF8Characters;
165 + uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
166 if (!uuid_is_valid (uuid_str))
169 @@ -578,6 +586,8 @@ plugin_get_errors (PluginObject *obj,
170 NULL, /* cancellable */
177 g_warning ("Failed to retrieve errors: %s", error->message);
180 From 02af8eb824bde8cc21b58365772d67e0d6c5992f Mon Sep 17 00:00:00 2001
181 From: Jasper St. Pierre <jstpierre@mecheye.net>
182 Date: Tue, 06 Dec 2011 20:00:52 +0000
183 Subject: browser-plugin: Fix memory leak when passing an invalid UUID
185 https://bugzilla.gnome.org/show_bug.cgi?id=665261
187 diff --git a/browser-plugin/browser-plugin.c b/browser-plugin/browser-plugin.c
188 index fccb061..a80a492 100644
189 --- a/browser-plugin/browser-plugin.c
190 +++ b/browser-plugin/browser-plugin.c
191 @@ -480,7 +480,10 @@ plugin_install_extension (PluginObject *obj,
193 gchar *uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
194 if (!uuid_is_valid (uuid_str))
201 g_dbus_proxy_call (obj->proxy,
202 "InstallRemoteExtension",
203 @@ -509,7 +512,10 @@ plugin_uninstall_extension (PluginObject *obj,
205 uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
206 if (!uuid_is_valid (uuid_str))
213 res = g_dbus_proxy_call_sync (obj->proxy,
214 "UninstallExtension",
215 @@ -543,7 +549,10 @@ plugin_get_info (PluginObject *obj,
217 uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
218 if (!uuid_is_valid (uuid_str))
225 res = g_dbus_proxy_call_sync (obj->proxy,
227 @@ -576,7 +585,10 @@ plugin_get_errors (PluginObject *obj,
229 uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length);
230 if (!uuid_is_valid (uuid_str))
237 res = g_dbus_proxy_call_sync (obj->proxy,
238 "GetExtensionErrors",