[gtk+] cssvalue: Don't crash when printing NULL strings
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cssvalue: Don't crash when printing NULL strings
- Date: Fri, 28 Sep 2012 16:29:26 +0000 (UTC)
commit 94c0c1542beca262fe1e90566f8b887d1ccb2c95
Author: Benjamin Otte <otte redhat com>
Date: Thu Sep 27 16:23:53 2012 +0200
cssvalue: Don't crash when printing NULL strings
A NULL string should be printed as "none".
gtk/gtkcssstringvalue.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssstringvalue.c b/gtk/gtkcssstringvalue.c
index 9edda64..02405f4 100644
--- a/gtk/gtkcssstringvalue.c
+++ b/gtk/gtkcssstringvalue.c
@@ -65,6 +65,12 @@ gtk_css_value_string_print (const GtkCssValue *value,
char *string = value->string;
gsize len;
+ if (string == NULL)
+ {
+ g_string_append (str, "none");
+ return;
+ }
+
g_string_append_c (str, '"');
do {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]