Commit 0e9e006a authored by Rocky Automation's avatar Rocky Automation 📺
Browse files

import yelp-3.28.1-3.el8

parents
SOURCES/yelp-3.28.1.tar.xz
2781090d6dc3227212de46b04de88c92053b8340 SOURCES/yelp-3.28.1.tar.xz
From 18a82693d550f4d19c4310741dc60cfef605079a Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 09:01:18 +0200
Subject: [PATCH 01/17] Add gnu_printf format attribute to yelp_debug
yelp-3.28.1/libyelp/yelp-debug.c:150:3: warning: function 'yelp_debug' might be
a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
---
libyelp/yelp-debug.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libyelp/yelp-debug.h b/libyelp/yelp-debug.h
index 620a4bf1..18c5582e 100644
--- a/libyelp/yelp-debug.h
+++ b/libyelp/yelp-debug.h
@@ -67,8 +67,9 @@ typedef enum {
#endif
G_GNUC_INTERNAL
-void yelp_debug (const gchar *file, guint line,
- const gchar *function, guint flags, const gchar *format, ...);
+void yelp_debug (const gchar *file, guint line,
+ const gchar *function, guint flags,
+ const gchar *format, ...) __attribute__ ((format (gnu_printf, 5, 6)));
G_END_DECLS
--
2.19.1
From c323dd5087a15cb2b820fedf311ca288ec347878 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Thu, 8 Nov 2012 22:57:12 -0500
Subject: [PATCH] Center new windows
This makes more sense than letting mutter put them in the top
left corner.
---
src/yelp-application.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/yelp-application.c b/src/yelp-application.c
index 2d004c2..e669661 100644
--- a/src/yelp-application.c
+++ b/src/yelp-application.c
@@ -444,6 +444,7 @@ application_uri_resolved (YelpUri *uri,
g_settings_get (settings, "geometry", "(ii)", &width, &height);
window = yelp_window_new (data->app);
+ gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
g_signal_connect (window, "resized", G_CALLBACK (window_resized), data->app);
priv->windows = g_slist_prepend (priv->windows, window);
--
1.7.12.1
From b8fdfcae060bdffb15d81e68cdff011105013eb0 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@igalia.com>
Date: Fri, 18 May 2018 09:56:16 -0500
Subject: [PATCH] Fix build with GCC 8
Yelp enables -Werror by default, so it's responsible for predicting and
fixing future compiler warnings that only an oracle could know about. In
this case, that turned out to be -Werror=cast-function-type.
---
libyelp/yelp-docbook-document.c | 6 +++---
libyelp/yelp-document.c | 4 ++--
libyelp/yelp-help-list.c | 2 +-
libyelp/yelp-info-document.c | 2 +-
libyelp/yelp-mallard-document.c | 6 +++---
libyelp/yelp-man-document.c | 2 +-
libyelp/yelp-simple-document.c | 2 +-
libyelp/yelp-transform.c | 2 +-
libyelp/yelp-uri.c | 2 +-
9 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c
index 9b430b09..6ecaf316 100644
--- a/libyelp/yelp-docbook-document.c
+++ b/libyelp/yelp-docbook-document.c
@@ -273,7 +273,7 @@ docbook_request_page (YelpDocument *document,
priv->process_running = TRUE;
g_object_ref (document);
priv->thread = g_thread_new ("docbook-page",
- (GThreadFunc) docbook_process,
+ (GThreadFunc)(GCallback) docbook_process,
document);
break;
case DOCBOOK_STATE_PARSING:
@@ -495,7 +495,7 @@ docbook_reload (YelpDocbookDocument *docbook)
priv->process_running = TRUE;
g_object_ref (docbook);
priv->thread = g_thread_new ("docbook-reload",
- (GThreadFunc) docbook_process,
+ (GThreadFunc)(GCallback) docbook_process,
docbook);
g_mutex_unlock (&priv->mutex);
@@ -1077,7 +1077,7 @@ docbook_index (YelpDocument *document)
priv = GET_PRIV (document);
g_object_ref (document);
priv->index = g_thread_new ("docbook-index",
- (GThreadFunc) docbook_index_threaded,
+ (GThreadFunc)(GCallback) docbook_index_threaded,
document);
priv->index_running = TRUE;
}
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index 6adbbb1d..c1eec9cc 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -330,7 +330,7 @@ yelp_document_dispose (GObject *object)
if (document->priv->reqs_all) {
g_slist_foreach (document->priv->reqs_all,
- (GFunc) request_try_free,
+ (GFunc)(GCallback) request_try_free,
NULL);
g_slist_free (document->priv->reqs_all);
document->priv->reqs_all = NULL;
@@ -338,7 +338,7 @@ yelp_document_dispose (GObject *object)
if (document->priv->reqs_search) {
g_slist_foreach (document->priv->reqs_search,
- (GFunc) request_try_free,
+ (GFunc)(GCallback) request_try_free,
NULL);
g_slist_free (document->priv->reqs_search);
document->priv->reqs_search = NULL;
diff --git a/libyelp/yelp-help-list.c b/libyelp/yelp-help-list.c
index 9005e48f..cbac98bf 100644
--- a/libyelp/yelp-help-list.c
+++ b/libyelp/yelp-help-list.c
@@ -210,7 +210,7 @@ help_list_request_page (YelpDocument *document,
priv->process_running = TRUE;
g_object_ref (document);
priv->thread = g_thread_new ("helplist-page",
- (GThreadFunc) help_list_think,
+ (GThreadFunc)(GCallback) help_list_think,
document);
}
priv->pending = g_slist_prepend (priv->pending, g_strdup (page_id));
diff --git a/libyelp/yelp-info-document.c b/libyelp/yelp-info-document.c
index 7b532744..d55be325 100644
--- a/libyelp/yelp-info-document.c
+++ b/libyelp/yelp-info-document.c
@@ -209,7 +209,7 @@ info_request_page (YelpDocument *document,
priv->process_running = TRUE;
g_object_ref (document);
priv->thread = g_thread_new ("info-page",
- (GThreadFunc) info_document_process,
+ (GThreadFunc)(GCallback) info_document_process,
document);
break;
case INFO_STATE_PARSING:
diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c
index fc7c4d7c..74fc80ee 100644
--- a/libyelp/yelp-mallard-document.c
+++ b/libyelp/yelp-mallard-document.c
@@ -287,7 +287,7 @@ mallard_request_page (YelpDocument *document,
priv->thread_running = TRUE;
g_object_ref (document);
priv->thread = g_thread_new ("mallard-page",
- (GThreadFunc) mallard_think,
+ (GThreadFunc)(GCallback) mallard_think,
document);
}
@@ -1100,7 +1100,7 @@ mallard_index (YelpDocument *document)
priv = GET_PRIV (document);
g_object_ref (document);
priv->index = g_thread_new ("mallard-index",
- (GThreadFunc) mallard_index_threaded,
+ (GThreadFunc)(GCallback) mallard_index_threaded,
document);
priv->index_running = TRUE;
}
@@ -1148,7 +1148,7 @@ mallard_monitor_changed (GFileMonitor *monitor,
priv->thread_running = TRUE;
g_object_ref (mallard);
priv->thread = g_thread_new ("mallard-reload",
- (GThreadFunc) mallard_think,
+ (GThreadFunc)(GCallback) mallard_think,
mallard);
g_mutex_unlock (&priv->mutex);
diff --git a/libyelp/yelp-man-document.c b/libyelp/yelp-man-document.c
index 4e165d57..ad7fab4f 100644
--- a/libyelp/yelp-man-document.c
+++ b/libyelp/yelp-man-document.c
@@ -243,7 +243,7 @@ man_request_page (YelpDocument *document,
yelp_document_set_page_id (document, priv->page_id, priv->page_id);
yelp_document_set_root_id (document, priv->page_id, priv->page_id);
priv->thread = g_thread_new ("man-page",
- (GThreadFunc) man_document_process,
+ (GThreadFunc)(GCallback) man_document_process,
document);
break;
case MAN_STATE_PARSING:
diff --git a/libyelp/yelp-simple-document.c b/libyelp/yelp-simple-document.c
index 501d7881..595efa83 100644
--- a/libyelp/yelp-simple-document.c
+++ b/libyelp/yelp-simple-document.c
@@ -131,7 +131,7 @@ yelp_simple_document_dispose (GObject *object)
YelpSimpleDocument *document = YELP_SIMPLE_DOCUMENT (object);
if (document->priv->reqs) {
- g_slist_foreach (document->priv->reqs, (GFunc) request_try_free, NULL);
+ g_slist_foreach (document->priv->reqs, (GFunc)(GCallback) request_try_free, NULL);
g_slist_free (document->priv->reqs);
document->priv->reqs = NULL;
}
diff --git a/libyelp/yelp-transform.c b/libyelp/yelp-transform.c
index 334438af..7a5dc86e 100644
--- a/libyelp/yelp-transform.c
+++ b/libyelp/yelp-transform.c
@@ -298,7 +298,7 @@ yelp_transform_start (YelpTransform *transform,
priv->running = TRUE;
g_object_ref (transform);
priv->thread = g_thread_new ("transform-run",
- (GThreadFunc) transform_run,
+ (GThreadFunc)(GCallback) transform_run,
transform);
g_mutex_unlock (&priv->mutex);
diff --git a/libyelp/yelp-uri.c b/libyelp/yelp-uri.c
index 317beead..f20b167e 100644
--- a/libyelp/yelp-uri.c
+++ b/libyelp/yelp-uri.c
@@ -298,7 +298,7 @@ resolve_start (YelpUri *uri)
if (priv->resolver == NULL) {
g_object_ref (uri);
priv->resolver = g_thread_new ("uri-resolve",
- (GThreadFunc) resolve_async,
+ (GThreadFunc)(GCallback) resolve_async,
uri);
}
}
--
2.17.1
From 3b4245db2e954675d15f50a0e9d004e62a43a48c Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 09:50:53 +0200
Subject: [PATCH 02/17] Check whether document has a root element before
accessing it.
yelp-3.28.1/libyelp/yelp-docbook-document.c:562:13: note: Access to field 'ns' results in a dereference of a null pointer (loaded from field 'xmlcur')
if (priv->xmlcur->ns) {
^ ~~~~~~
560| * unique value, and insert it into the in-memory tree */
561| g_snprintf (autoidstr, 20, "//autoid-%d", ++autoid);
562|-> if (priv->xmlcur->ns) {
563| xmlNewNsProp (priv->xmlcur,
564| xmlNewNs (priv->xmlcur, XML_XML_NAMESPACE, BAD_CAST "xml"),
yelp-3.28.1/libyelp/yelp-docbook-document.c:608:16: note: Access to field 'children' results in a dereference of a null pointer (loaded from field 'xmlcur')
for (cur = priv->xmlcur->children; cur; cur = cur->next) {
^ ~~~~~~
606| NULL);
607|
608|-> for (cur = priv->xmlcur->children; cur; cur = cur->next) {
609| if (cur->type == XML_ELEMENT_NODE) {
610| priv->xmlcur = cur;
---
libyelp/yelp-docbook-document.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c
index 6ecaf316..24746248 100644
--- a/libyelp/yelp-docbook-document.c
+++ b/libyelp/yelp-docbook-document.c
@@ -309,6 +309,7 @@ docbook_process (YelpDocbookDocument *docbook)
GFile *file = NULL;
gchar *filepath = NULL;
xmlDocPtr xmldoc = NULL;
+ xmlNodePtr xmlcur = NULL;
xmlChar *id = NULL;
xmlParserCtxtPtr parserCtxt = NULL;
GError *error;
@@ -343,7 +344,10 @@ docbook_process (YelpDocbookDocument *docbook)
XML_PARSE_DTDLOAD | XML_PARSE_NOCDATA |
XML_PARSE_NOENT | XML_PARSE_NONET );
- if (xmldoc == NULL) {
+ if (xmldoc)
+ xmlcur = xmlDocGetRootElement (xmldoc);
+
+ if (xmldoc == NULL || xmlcur == NULL) {
error = g_error_new (YELP_ERROR, YELP_ERROR_PROCESSING,
_("The file ‘%s’ could not be parsed because it is"
" not a well-formed XML document."),
@@ -374,7 +378,7 @@ docbook_process (YelpDocbookDocument *docbook)
priv->max_depth = 1;
priv->xmldoc = xmldoc;
- priv->xmlcur = xmlDocGetRootElement (xmldoc);
+ priv->xmlcur = xmlcur;
id = xmlGetProp (priv->xmlcur, BAD_CAST "id");
if (!id)
--
2.19.1
From 05fd1b7d267d83ad73f67bb99aac5c9ba069d4e5 Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 10:09:43 +0200
Subject: [PATCH 03/17] Check whether the index variable is valid before
dereferencing it
yelp-3.28.1/libyelp/yelp-docbook-document.c:1058: check_after_deref: Null-checking "index" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
yelp-3.28.1/libyelp/yelp-docbook-document.c:1026: deref_ptr: Directly dereferencing pointer "index".
yelp-3.28.1/libyelp/yelp-docbook-document.c:1054: deref_ptr: Directly dereferencing pointer "index".
1052| if (filename != NULL)
1053| g_free (filename);
1054|-> if (index->doc != NULL)
1055| xmlFreeDoc (index->doc);
1056| if (index->doc_uri != NULL)
---
libyelp/yelp-docbook-document.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c
index 24746248..afb49fb0 100644
--- a/libyelp/yelp-docbook-document.c
+++ b/libyelp/yelp-docbook-document.c
@@ -1055,12 +1055,13 @@ docbook_index_threaded (YelpDocbookDocument *docbook)
g_object_unref (file);
if (filename != NULL)
g_free (filename);
- if (index->doc != NULL)
- xmlFreeDoc (index->doc);
- if (index->doc_uri != NULL)
- g_free (index->doc_uri);
- if (index != NULL)
+ if (index != NULL) {
+ if (index->doc != NULL)
+ xmlFreeDoc (index->doc);
+ if (index->doc_uri != NULL)
+ g_free (index->doc_uri);
g_free (index);
+ }
if (parserCtxt != NULL)
xmlFreeParserCtxt (parserCtxt);
--
2.19.1
From 3ce3334e9f64eb9eb9f6f52608ca00c2fb74b516 Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 10:30:35 +0200
Subject: [PATCH 04/17] Correctly check whether virtual method is implemented
before calling it
yelp-3.28.1/libyelp/yelp-document.c:819:27: warning: Access to field 'request_page' results in a dereference of a null pointer (loaded from field 'g_class')
g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->request_page != NULL, FALSE);
yelp-3.28.1/libyelp/yelp-document.c:943:27: warning: Access to field 'read_contents' results in a dereference of a null pointer (loaded from field 'g_class')
g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->read_contents != NULL, NULL);
yelp-3.28.1/libyelp/yelp-document.c:1100:23: warning: Access to field 'finish_read' results in a dereference of a null pointer (loaded from field 'g_class')
g_return_if_fail (YELP_DOCUMENT_GET_CLASS (document)->finish_read != NULL);
yelp-3.28.1/libyelp/yelp-document.c:1141:27: warning: Access to field 'get_mime_type' results in a dereference of a null pointer (loaded from field 'g_class')
g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->get_mime_type != NULL, NULL);
yelp-3.28.1/libyelp/yelp-document.c:1173:23: warning: Access to field 'index' results in a dereference of a null pointer (loaded from field 'g_class')
g_return_if_fail (YELP_DOCUMENT_GET_CLASS (document)->index != NULL);
---
libyelp/yelp-document.c | 56 ++++++++++++++++++++++++++++++-----------
1 file changed, 41 insertions(+), 15 deletions(-)
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index c1eec9cc..d832d1ed 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -815,17 +815,19 @@ yelp_document_request_page (YelpDocument *document,
gpointer user_data,
GDestroyNotify notify)
{
+ YelpDocumentClass *klass;
+
+ g_return_val_if_fail (document != NULL, FALSE);
g_return_val_if_fail (YELP_IS_DOCUMENT (document), FALSE);
- g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->request_page != NULL, FALSE);
+
+ klass = YELP_DOCUMENT_GET_CLASS (document);
+ g_return_val_if_fail (klass != NULL, FALSE);
+ g_return_val_if_fail (klass->request_page != NULL, FALSE);
debug_print (DB_FUNCTION, "entering\n");
- return YELP_DOCUMENT_GET_CLASS (document)->request_page (document,
- page_id,
- cancellable,
- callback,
- user_data,
- notify);
+ return klass->request_page (document, page_id, cancellable, callback,
+ user_data, notify);
}
static gboolean
@@ -939,10 +941,16 @@ const gchar *
yelp_document_read_contents (YelpDocument *document,
const gchar *page_id)
{
+ YelpDocumentClass *klass;
+
+ g_return_val_if_fail (document != NULL, NULL);
g_return_val_if_fail (YELP_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->read_contents != NULL, NULL);
- return YELP_DOCUMENT_GET_CLASS (document)->read_contents (document, page_id);
+ klass = YELP_DOCUMENT_GET_CLASS (document);
+ g_return_val_if_fail (klass != NULL, FALSE);
+ g_return_val_if_fail (klass->read_contents != NULL, FALSE);
+
+ return klass->read_contents (document, page_id);
}
static const gchar *
@@ -1096,10 +1104,16 @@ void
yelp_document_finish_read (YelpDocument *document,
const gchar *contents)
{
+ YelpDocumentClass *klass;
+
+ g_return_if_fail (document != NULL);
g_return_if_fail (YELP_IS_DOCUMENT (document));
- g_return_if_fail (YELP_DOCUMENT_GET_CLASS (document)->finish_read != NULL);
- YELP_DOCUMENT_GET_CLASS (document)->finish_read (document, contents);
+ klass = YELP_DOCUMENT_GET_CLASS (document);
+ g_return_if_fail (klass != NULL);
+ g_return_if_fail (klass->finish_read != NULL);
+
+ klass->finish_read (document, contents);
}
static void
@@ -1137,10 +1151,16 @@ gchar *
yelp_document_get_mime_type (YelpDocument *document,
const gchar *page_id)
{
+ YelpDocumentClass *klass;
+
+ g_return_val_if_fail (document != NULL, NULL);
g_return_val_if_fail (YELP_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->get_mime_type != NULL, NULL);
- return YELP_DOCUMENT_GET_CLASS (document)->get_mime_type (document, page_id);
+ klass = YELP_DOCUMENT_GET_CLASS (document);
+ g_return_val_if_fail (klass != NULL, NULL);
+ g_return_val_if_fail (klass->get_mime_type != NULL, FALSE);
+
+ return klass->get_mime_type (document, page_id);
}
static gchar *
@@ -1169,10 +1189,16 @@ document_get_mime_type (YelpDocument *document,
void
yelp_document_index (YelpDocument *document)
{
+ YelpDocumentClass *klass;
+
+ g_return_if_fail (document != NULL);
g_return_if_fail (YELP_IS_DOCUMENT (document));
- g_return_if_fail (YELP_DOCUMENT_GET_CLASS (document)->index != NULL);
- YELP_DOCUMENT_GET_CLASS (document)->index (document);
+ klass = YELP_DOCUMENT_GET_CLASS (document);
+ g_return_if_fail (klass != NULL);
+ g_return_if_fail (klass->index != NULL);
+
+ klass->index (document);
}
static void
--
2.19.1
From 92974634d285448bbf2007a9bcfedf247a26a39b Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 10:55:52 +0200
Subject: [PATCH 05/17] Check whether variable node is set before dereferencing
it
yelp-3.28.1/libyelp/yelp-info-parser.c:766: dereference: Dereferencing a pointer that might be null "node" when calling "strncmp".
---
libyelp/yelp-info-parser.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libyelp/yelp-info-parser.c b/libyelp/yelp-info-parser.c
index d0e767bc..0c383bfe 100644
--- a/libyelp/yelp-info-parser.c
+++ b/libyelp/yelp-info-parser.c
@@ -734,7 +734,7 @@ process_page (GtkTreeStore *tree,
g_free (next);
next = NULL;
}
- if (g_str_equal (node, "Top") && prev != NULL) {
+ if (node && g_str_equal (node, "Top") && prev != NULL) {
g_free (prev);
prev = NULL;
}
@@ -763,7 +763,7 @@ process_page (GtkTreeStore *tree,
}
if (prev && g_ascii_strncasecmp (prev, "(dir)", 5))
{
- if (strncmp (node, "Top", 3)) {
+ if (node && strncmp (node, "Top", 3)) {
/* Special case the Top node to always appear first */
} else {
page = node2page (nodes2pages, prev);
--
2.19.1
From d7d1c089196e4e1bef314d6d6a01caffd6bba1da Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 10:57:33 +0200
Subject: [PATCH 06/17] Fix a use of an uninitialized variable
yelp-3.28.1/libyelp/yelp-info-parser.c:1174: var_decl: Declaring variable "menu_node" without initializer.
yelp-3.28.1/libyelp/yelp-info-parser.c:1310: uninit_use: Using uninitialized value "menu_node".
1308| else if (*(menuitems[i]) != '\0') {
1309| tmp = g_strconcat ("\n", first_non_space (menuitems[i]), NULL);
1310|-> xmlNewTextChild (mholder ? mholder : menu_node,
1311| NULL, BAD_CAST "para1",
1312| BAD_CAST tmp);
---
libyelp/yelp-info-parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libyelp/yelp-info-parser.c b/libyelp/yelp-info-parser.c
index 0c383bfe..ed16e373 100644
--- a/libyelp/yelp-info-parser.c
+++ b/libyelp/yelp-info-parser.c
@@ -1171,7 +1171,7 @@ yelp_info_parse_menu (GtkTreeStore *tree, xmlNodePtr *node,
gchar **split;
gchar **menuitems;
gchar *tmp = NULL;
- xmlNodePtr newnode, menu_node, mholder = NULL;
+ xmlNodePtr newnode, menu_node = NULL, mholder = NULL;
int i=0;
split = g_strsplit (page_content, "* Menu:", 2);
--
2.19.1
From 79e59e9d374e635ca65b4d24c59fffacc5425b1a Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 11:04:35 +0200
Subject: [PATCH 07/17] Check whether the index variable is valid before
dereferencing it
yelp-3.28.1/libyelp/yelp-mallard-document.c:1002: deref_ptr: Directly dereferencing pointer "index".
yelp-3.28.1/libyelp/yelp-mallard-document.c:1073: check_after_deref: Null-checking "index" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
---
libyelp/yelp-mallard-document.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c
index 74fc80ee..9c006efc 100644
--- a/libyelp/yelp-mallard-document.c
+++ b/libyelp/yelp-mallard-document.c
@@ -1070,8 +1070,7 @@ mallard_index_threaded (YelpMallardDocument *mallard)
xmlXPathFreeContext (xpath);
if (index->doc != NULL)
xmlFreeDoc (index->doc);
- if (index != NULL)
- g_free (index);
+ g_free (index);
if (parserCtxt != NULL)
xmlFreeParserCtxt (parserCtxt);
g_object_unref (pagefile);
--
2.19.1
From 33bf987013a6f7c875dc643a74e11beba4a12f03 Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Mon, 23 Jul 2018 11:15:10 +0200
Subject: [PATCH 08/17] Check whether parser is null before dereferencing it
yelp-3.28.1/libyelp/yelp-man-parser.c:445: var_compare_op: Comparing "parser" to null implies that "parser" might be null.
yelp-3.28.1/libyelp/yelp-man-parser.c:449: var_deref_op: Dereferencing null pointer "parser".
---
libyelp/yelp-man-parser.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/libyelp/yelp-man-parser.c b/libyelp/yelp-man-parser.c
index 46073a2e..8d097820 100644
--- a/libyelp/yelp-man-parser.c
+++ b/libyelp/yelp-man-parser.c