Merge lp://staging/~3v1n0/bamf/mime-types-fix-crash-1058260 into lp://staging/bamf/0.4
Proposed by
Marco Trevisan (Treviño)
Status: | Merged |
---|---|
Approved by: | Michal Hruby |
Approved revision: | 491 |
Merged at revision: | 485 |
Proposed branch: | lp://staging/~3v1n0/bamf/mime-types-fix-crash-1058260 |
Merge into: | lp://staging/bamf/0.4 |
Diff against target: |
341 lines (+97/-61) 4 files modified
lib/libbamf/bamf-application.c (+2/-4) src/bamf-application.c (+42/-57) tests/bamfdaemon/data/mime-types.desktop (+10/-0) tests/bamfdaemon/test-application.c (+43/-0) |
To merge this branch: | bzr merge lp://staging/~3v1n0/bamf/mime-types-fix-crash-1058260 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michal Hruby (community) | Approve | ||
Review via email: mp+127225@code.staging.launchpad.net |
Commit message
Daemon, BamfApplication: fix a crash on getting the supported mimes
Also remove the unneeded mimes_initialized, just use the pointer value and add tests.
Description of the change
Fix the function bamf_applicatio
Tests added.
To post a comment you must log in.
66 + if (!new_mimes)
67 {
68 gchar *empty[] = {NULL};
69 -
70 - mimes = g_strdupv (empty);
71 + mimes = empty;
72 }
Ouch, looks pretty dangerous, you're taking address of a temporary that's not valid outside of that block.
181 + for (it = mimes; *it; it++) builder_ add (&b, "s", *it);
182 + {
183 + g_variant_
184 + }
Why so complicated? How about g_variant_ new_strv( )? (or perhaps `g_variant_ new("(@ as)", g_variant_ new_strv( ...));` )