]> www.fi.muni.cz Git - evince.git/commitdiff
Guard against using g_strstrip on NULL. Fixes bug #317291.
authorChristian Persch <chpe@cvs.gnome.org>
Mon, 26 Sep 2005 22:03:01 +0000 (22:03 +0000)
committerChristian Persch <chpe@src.gnome.org>
Mon, 26 Sep 2005 22:03:01 +0000 (22:03 +0000)
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.

ChangeLog
shell/ev-window-title.c

index 653e6edddd092a2d274ac4d8fbbda59e7ebd9442..840366e00f4a9a95db403d750e29194745d381f9 100644 (file)
--- 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:
index a7229e9d259f9dda40398733bd208a7a7aa6038f..2964f1414d571d2ebc2c57307254e17d4c92fbca 100644 (file)
@@ -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);
+                       }
                }
        }