After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694129 - Ignoring firmware updates is broken
Ignoring firmware updates is broken
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: updates
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-18 22:28 UTC by Elliott Sales de Andrade
Modified: 2013-02-19 22:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix firmware update plugin (2.22 KB, patch)
2013-02-18 22:28 UTC, Elliott Sales de Andrade
committed Details | Review

Description Elliott Sales de Andrade 2013-02-18 22:28:37 UTC
Created attachment 236673 [details] [review]
Fix firmware update plugin

I accidentally clicked Ignore on some popup that asked me to install some additional firmware. Following that, gnome-settings-daemon began crashing when I logged in. A backtrace can be found on Fedora's bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=912249

I have looked at the code, and found two issues stemming from a misuse of g_ptr_array_remove_index_fast. This function calls the `free_function` passed when the GPtrArray is created. But the code also calls the `free_function` thus causing a double-free. Additionally, g_ptr_array_remove_index_fast replaces the indexed element with the last element. What that means is that the current index must *still* be checked, but the for loop means it will be skipped.

I have attached a patch that fixes the crash and the skipping of elements.
Comment 1 Bastien Nocera 2013-02-19 07:47:51 UTC
I fixed the fact that "ret" was not reset for each loop iteration, and pushed to gnome-3-6 and master, thanks.
Comment 2 Elliott Sales de Andrade 2013-02-19 22:48:17 UTC
Ah yes, I meant to do that and forgot about it. Thanks.