[gtk+/gtk-3-8] printing: Don't crash when printer-state-message not provided
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] printing: Don't crash when printer-state-message not provided
- Date: Thu, 9 May 2013 13:15:37 +0000 (UTC)
commit 7e86d69854fdf50fc99f0314922898e63ff1d806
Author: Marek Kasik <mkasik redhat com>
Date: Mon May 6 13:43:18 2013 +0200
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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c
b/modules/printbackends/cups/gtkprintbackendcups.c
index 80d868c..0093c31 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]