Bug 115624 - [GTK] Initialize WebKitWebPlugin path to prevent double-free
Summary: [GTK] Initialize WebKitWebPlugin path to prevent double-free
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 00:41 PDT by Tomas Popela
Modified: 2013-05-07 00:41 PDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (1.63 KB, patch)
2013-05-06 00:49 PDT, Tomas Popela
no flags Details | Formatted Diff | Diff
Proposed patch v2 (3.88 KB, patch)
2013-05-06 06:30 PDT, Tomas Popela
mrobinson: review+
mrobinson: commit-queue-
Details | Formatted Diff | Diff
Proposed patch v3 (3.86 KB, patch)
2013-05-07 00:04 PDT, Tomas Popela
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Popela 2013-05-06 00:41:06 PDT
Initialize WebKitWebPlugin path in webkitwebplugin.cpp to prevent double-free on OpenBSD: https://bugzilla.gnome.org/show_bug.cgi?id=684245#c20
Comment 1 Tomas Popela 2013-05-06 00:49:02 PDT
Created attachment 200639 [details]
Proposed patch
Comment 2 Carlos Garcia Campos 2013-05-06 00:58:10 PDT
Comment on attachment 200639 [details]
Proposed patch

Oh!, this happens because webkitwebplugin is doing new WebKitWebPluginPrivate(). I think a better fix would be to use GOwnPtr<char> for the path. GOwnPtr initializes the internal pointer on construction and you can remove all the g_free.
Comment 3 Tomas Popela 2013-05-06 06:30:51 PDT
Created attachment 200664 [details]
Proposed patch v2

WebKitWebPlugin path and also error variable in webkit_web_plugin_get_path are now using GOwnPtr
Comment 4 WebKit Commit Bot 2013-05-06 06:33:09 PDT
Attachment 200664 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/gtk/ChangeLog', u'Source/WebKit/gtk/webkit/webkitwebplugin.cpp', u'Source/WebKit/gtk/webkit/webkitwebpluginprivate.h']" exit_code: 1
Source/WebKit/gtk/webkit/webkitwebpluginprivate.h:25:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Martin Robinson 2013-05-06 08:17:17 PDT
Comment on attachment 200664 [details]
Proposed patch v2

Looks good to me, but please fix the style error.
Comment 6 Tomas Popela 2013-05-07 00:04:10 PDT
Created attachment 200877 [details]
Proposed patch v3

Fixes style error.
Comment 7 WebKit Commit Bot 2013-05-07 00:41:26 PDT
Comment on attachment 200877 [details]
Proposed patch v3

Clearing flags on attachment: 200877

Committed r149666: <http://trac.webkit.org/changeset/149666>
Comment 8 WebKit Commit Bot 2013-05-07 00:41:28 PDT
All reviewed patches have been landed.  Closing bug.