[yelp] Fix crash on searching.



commit a6d3b1c2a109514cd0e16c3a98c9952e641a4fa4
Author: Marcos Chavarría Teijeiro <chavarria1991 gmail com>
Date:   Tue Sep 9 10:51:36 2014 +0200

    Fix crash on searching.
    
    I have moved page_id lookup to the line before the if block
    where we construct the search page result. So when we lookup for
    the document content using the page_id, it's available and the program
    doesn't throw a segmentation fault.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736312

 libyelp/yelp-document.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index 68041ac..d62e498 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -917,6 +917,8 @@ document_read_contents (YelpDocument *document,
 
     g_mutex_lock (&document->priv->mutex);
 
+    real = hash_lookup (document->priv->page_ids, page_id);
+
     if (page_id != NULL && g_str_has_prefix (page_id, "search=")) {
         gchar *tmp, *tmp2, *txt;
         GVariant *value;
@@ -1038,7 +1040,6 @@ document_read_contents (YelpDocument *document,
         return (const gchar *) str;
     }
 
-    real = hash_lookup (document->priv->page_ids, page_id);
     str = hash_lookup (document->priv->contents, real);
     if (str)
        str_ref (str);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]