summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Kasik <mkasik@redhat.com>2013-05-06 13:43:18 +0200
committerMarek Kasik <mkasik@redhat.com>2013-05-09 15:13:59 +0200
commitbdf40603d5293f9fd95aaa76b2fa36520c37f73b (patch)
tree4cb55936f80b145d6a79196078ecbf2010933102
parenta725b063638c315b38569988105791dd2dc4c0ba (diff)
downloadgtk+-bdf40603d5293f9fd95aaa76b2fa36520c37f73b.tar.gz
printing: Don't crash when printer-state-message not provided
Check whether "printer-state-message" was returned before its usage. https://bugzilla.gnome.org/show_bug.cgi?id=699750
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 34c6eac3e5..5656615606 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -2320,7 +2320,7 @@ set_info_state_message (PrinterSetupInfo *info)
if (info->reason_level >= GTK_PRINTER_STATE_LEVEL_WARNING)
{
- if (strlen (info->state_msg) == 0)
+ if (info->state_msg == NULL || info->state_msg[0] == '\0')
{
g_free (info->state_msg);
info->state_msg = reason_msg_desc;