From 8e6d88c8b0d2871ec61a42f38352425122281be6 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 26 Sep 2005 22:03:01 +0000 Subject: [PATCH] Guard against using g_strstrip on NULL. Fixes bug #317291. 2005-09-27 Christian Persch * shell/ev-window-title.c: (ev_window_title_update): Guard against using g_strstrip on NULL. Fixes bug #317291. --- ChangeLog | 6 ++++++ shell/ev-window-title.c | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 653e6edd..840366e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-09-27 Christian Persch + + * 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 * pdf/ev-poppler.cc: diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c index a7229e9d..2964f141 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); + } } } -- 2.43.5