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 665689 - [patch] Don't crash when receiving a malformed d-bus signal
[patch] Don't crash when receiving a malformed d-bus signal
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: printers
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-12-06 19:38 UTC by Lars Karlitski
Modified: 2012-03-09 11:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
print-notifications test tool (3.58 KB, patch)
2011-12-06 19:39 UTC, Lars Karlitski
committed Details | Review
detect malformed d-bus signals (1.22 KB, patch)
2011-12-06 19:40 UTC, Lars Karlitski
none Details | Review
detect malformed d-bus signals (1.33 KB, patch)
2011-12-07 13:38 UTC, Lars Karlitski
none Details | Review
detect malformed d-bus signals (1.33 KB, patch)
2011-12-07 14:42 UTC, Lars Karlitski
committed Details | Review

Description Lars Karlitski 2011-12-06 19:38:54 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.
Comment 1 Lars Karlitski 2011-12-06 19:39:53 UTC
Created attachment 202929 [details] [review]
print-notifications test tool
Comment 2 Lars Karlitski 2011-12-06 19:40:18 UTC
Created attachment 202930 [details] [review]
detect malformed d-bus signals
Comment 3 Matthias Clasen 2011-12-07 12:29:09 UTC
The commit message should have a reference to the cups bug report / fix.
Comment 4 Lars Karlitski 2011-12-07 13:38:01 UTC
Created attachment 202987 [details] [review]
detect malformed d-bus signals

I agree.  I added a reference to the CUPS bug to the commit message.
Comment 5 Marek Kašík 2011-12-07 14:28:52 UTC
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
Comment 6 Lars Karlitski 2011-12-07 14:42:14 UTC
Created attachment 202992 [details] [review]
detect malformed d-bus signals
Comment 7 Marek Kašík 2011-12-07 15:25:38 UTC
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
Comment 8 Bastien Nocera 2012-03-09 11:14:59 UTC
Pushed the test app, thanks.