From bdf40603d5293f9fd95aaa76b2fa36520c37f73b Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Mon, 6 May 2013 13:43:18 +0200 Subject: [PATCH] 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 --- modules/printbackends/cups/gtkprintbackendcups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;