Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-09-26 22:03:01 (GMT)
committer Christian Persch <chpe@src.gnome.org>2005-09-26 22:03:01 (GMT)
commit8e6d88c8b0d2871ec61a42f38352425122281be6 (patch)
tree1b82e1c3ff8066254e427e0ea32a40ef984b396e
parentc51cd462314ed115f17ad1e20d3db2a362a308f7 (diff)
Guard against using g_strstrip on NULL. Fixes bug #317291.
2005-09-27 Christian Persch <chpe@cvs.gnome.org> * shell/ev-window-title.c: (ev_window_title_update): Guard against using g_strstrip on NULL. Fixes bug #317291.
-rw-r--r--ChangeLog6
-rw-r--r--shell/ev-window-title.c12
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 653e6ed..840366e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-27 Christian Persch <chpe@cvs.gnome.org>
+
+ * shell/ev-window-title.c: (ev_window_title_update):
+
+ Guard against using g_strstrip on NULL. Fixes bug #317291.
+
2005-09-26 Marco Pesenti Gritti <mpg@redhat.com>
* pdf/ev-poppler.cc:
diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c
index a7229e9..2964f14 100644
--- a/shell/ev-window-title.c
+++ b/shell/ev-window-title.c
@@ -105,12 +105,14 @@ ev_window_title_update (EvWindowTitle *window_title)
g_return_if_fail (page_cache != NULL);
doc_title = (char *)ev_page_cache_get_title (page_cache);
- doc_title = g_strstrip (doc_title);
-
/* Make sure we get a valid title back */
- if (doc_title && doc_title[0] != '\000' &&
- g_utf8_validate (doc_title, -1, NULL)) {
- title = g_strdup (doc_title);
+ if (doc_title != NULL) {
+ doc_title = g_strstrip (doc_title);
+
+ if (doc_title[0] != '\0' &&
+ g_utf8_validate (doc_title, -1, NULL)) {
+ title = g_strdup (doc_title);
+ }
}
}