Merge lp:~vrruiz/nspluginwrapper/fix-raring into lp:nspluginwrapper

Proposed by Víctor R. Ruiz
Status: Needs review
Proposed branch: lp:~vrruiz/nspluginwrapper/fix-raring
Merge into: lp:nspluginwrapper
Diff against target: 15 lines (+1/-1)
1 file modified
debian/patches/005_process_env_dirs.diff (+1/-1)
To merge this branch: bzr merge lp:~vrruiz/nspluginwrapper/fix-raring
Reviewer Review Type Date Requested Status
Brian Murray Needs Fixing
Review via email: mp+165680@code.launchpad.net

Commit message

Fix segfault in Raring.

Description of the change

nspluginwrapper segfaults in Raring. This happens because get_env_plugin_dirs doesn't set correctly the count when NSPLUGIN_DIRS env variable is not set in 005_process_env_dirs.diff:

+const gchar **get_env_plugin_dirs(int *count)
+{
+ char *ns_plugin_dir = getenv("NSPLUGIN_DIRS");
+ *count = 0;
+ if (ns_plugin_dir == NULL)
+ return NULL;

Segfault is produced in get_mozilla_plugin_dirs n_env_dirs, when accessing dirs variable (malloc doesn't work correctly, because n_env_dirs is not set to 0).

+ const gchar **env_dirs = get_env_plugin_dirs(&n_env_dirs);
+ const char **dirs = malloc((n_default_dirs + n_env_dirs + 2) * sizeof(dirs[0]));

To post a comment you must log in.
58. By Víctor R. Ruiz

Fix segfault in raring

Revision history for this message
Brian Murray (brian-murray) wrote :

This did not seem to fix the crash in raring for me. nspluginwrapper --list still crashes and purging nspluginwrapper and nspluginviewer and then reinstalling them still causes a coredump.

review: Needs Fixing

Unmerged revisions

58. By Víctor R. Ruiz

Fix segfault in raring

57. By Víctor R. Ruiz

Fix segfault in Raring

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/patches/005_process_env_dirs.diff'
--- debian/patches/005_process_env_dirs.diff 2009-04-02 14:37:55 +0000
+++ debian/patches/005_process_env_dirs.diff 2013-05-29 16:22:25 +0000
@@ -22,10 +22,10 @@
22 22
23+const gchar **get_env_plugin_dirs(int *count)23+const gchar **get_env_plugin_dirs(int *count)
24+{24+{
25+ *count = 0;
25+ char *ns_plugin_dir = getenv("NSPLUGIN_DIRS");26+ char *ns_plugin_dir = getenv("NSPLUGIN_DIRS");
26+ if (ns_plugin_dir == NULL)27+ if (ns_plugin_dir == NULL)
27+ return NULL;28+ return NULL;
28+ *count = 0;
29+ const gchar **ns_plugin_dirs = g_strsplit((gchar *)ns_plugin_dir, ":", -1);29+ const gchar **ns_plugin_dirs = g_strsplit((gchar *)ns_plugin_dir, ":", -1);
30+ const gchar **iter = ns_plugin_dirs;30+ const gchar **iter = ns_plugin_dirs;
31+ while (*iter) {31+ while (*iter) {

Subscribers

People subscribed via source and target branches

to all changes: