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 699750 - Print dialog crashes when printer does not provide printer-state-message
Print dialog crashes when printer does not provide printer-state-message
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-05-06 11:52 UTC by Marek Kašík
Modified: 2013-05-09 13:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
don't crash when printer-state-message not provided (1.02 KB, patch)
2013-05-06 11:52 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2013-05-06 11:52:56 UTC
Created attachment 243377 [details] [review]
don't crash when printer-state-message not provided

Since the attribute "printer-state-message" is not strictly required by IPP, it can happen that a particular printer doesn't provide it (especially when printing to an avahi printer). This leads to a crash in set_info_state_message().

Attached patch fixes this bug.

This was originally reported here: https://bugzilla.redhat.com/show_bug.cgi?id=952935

Marek
Comment 1 Marek Kašík 2013-05-09 13:17:24 UTC
Comment on attachment 243377 [details] [review]
don't crash when printer-state-message not provided

I've committed slightly modified version of the patch to 3.8 and master:

-          if (strlen (info->state_msg) == 0)
+          if (info->state_msg == NULL || info->state_msg[0] == '\0')