GNOME Bugzilla – Bug 665689
[patch] Don't crash when receiving a malformed d-bus signal
Last modified: 2012-03-09 11:14:59 UTC
gnome-settings-daemon crashes when receiving Printer* signals from CUPS that don't have the expected number of arguments. This happened in lp #893676 because the CUPS d-bus notifier tried to add a parameter containing an invalid utf8 string and didn't check the return value of dbus_message_iter_append_basic. Attached is a small patch that fixes this issue. Also attached is a patch which adds a test tool to the print-notification plugin, which I used to debug and test this issue. It's almost identical to that in plugins/media-keys.
Created attachment 202929 [details] [review] print-notifications test tool
Created attachment 202930 [details] [review] detect malformed d-bus signals
The commit message should have a reference to the cups bug report / fix.
Created attachment 202987 [details] [review] detect malformed d-bus signals I agree. I added a reference to the CUPS bug to the commit message.
Hi Lars, thank you for the patch. I have one last request, could you remove the "\n" from the g_warning, it is not necessary there. Or, if you want, I can remove it. I'll return to the test file later. Regards Marek
Created attachment 202992 [details] [review] detect malformed d-bus signals
Comment on attachment 202992 [details] [review] detect malformed d-bus signals I've committed your patch to master and gnome-3-2 branch. I'll leave this bug open until I'll get to the test tool. Thanks Marek
Pushed the test app, thanks.