Blame SOURCES/0003-loader-properly-load-the-treeinfo-attributes.patch

4c949f
From 5e09667f547a21a5621f6cafbe82aeb85bad7071 Mon Sep 17 00:00:00 2001
4c949f
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fabiano@fidencio.org>
4c949f
Date: Sun, 2 Dec 2018 16:37:57 +0100
4c949f
Subject: [PATCH] loader: properly load the treeinfo attributes
4c949f
MIME-Version: 1.0
4c949f
Content-Type: text/plain; charset=UTF-8
4c949f
Content-Transfer-Encoding: 8bit
4c949f
4c949f
treeinfo attributes haven't been loaded properly due to the change done
4c949f
in ab2ab35f, changing the hardcoded 9 to sizeof("treeinfo-").
4c949f
4c949f
The problem here is that size("treeinfo-") is 10, causing that any
4c949f
comparison to fail.
4c949f
4c949f
Let's change the sizeof("treeinfo-") to strlen("treeinfo-").
4c949f
4c949f
Signed-off-by: Fabiano FidĂȘncio <fabiano@fidencio.org>
4c949f
Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
4c949f
(cherry picked from commit d56e33b47c806522378f267b50c354e48df25f98)
4c949f
---
4c949f
 osinfo/osinfo_loader.c | 8 ++++----
4c949f
 1 file changed, 4 insertions(+), 4 deletions(-)
4c949f
4c949f
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
4c949f
index 898dee9..85f51ab 100644
4c949f
--- a/osinfo/osinfo_loader.c
4c949f
+++ b/osinfo/osinfo_loader.c
4c949f
@@ -1196,22 +1196,22 @@ static OsinfoTree *osinfo_loader_tree(OsinfoLoader *loader,
4c949f
             continue;
4c949f
 
4c949f
         if (g_str_equal((const gchar *)nodes[i]->name,
4c949f
-                        OSINFO_TREE_PROP_TREEINFO_FAMILY + sizeof("treeinfo-")))
4c949f
+                        OSINFO_TREE_PROP_TREEINFO_FAMILY + strlen("treeinfo-")))
4c949f
             osinfo_entity_set_param(OSINFO_ENTITY(tree),
4c949f
                                     OSINFO_TREE_PROP_TREEINFO_FAMILY,
4c949f
                                     (const gchar *)nodes[i]->children->content);
4c949f
         else if (g_str_equal((const gchar *)nodes[i]->name,
4c949f
-                             OSINFO_TREE_PROP_TREEINFO_VARIANT + sizeof("treeinfo-")))
4c949f
+                             OSINFO_TREE_PROP_TREEINFO_VARIANT + strlen("treeinfo-")))
4c949f
             osinfo_entity_set_param(OSINFO_ENTITY(tree),
4c949f
                                     OSINFO_TREE_PROP_TREEINFO_VARIANT,
4c949f
                                     (const gchar *)nodes[i]->children->content);
4c949f
         else if (g_str_equal((const gchar *)nodes[i]->name,
4c949f
-                             OSINFO_TREE_PROP_TREEINFO_VERSION + sizeof("treeinfo-")))
4c949f
+                             OSINFO_TREE_PROP_TREEINFO_VERSION + strlen("treeinfo-")))
4c949f
             osinfo_entity_set_param(OSINFO_ENTITY(tree),
4c949f
                                     OSINFO_TREE_PROP_TREEINFO_VERSION,
4c949f
                                     (const gchar *)nodes[i]->children->content);
4c949f
         else if (g_str_equal((const gchar *)nodes[i]->name,
4c949f
-                             OSINFO_TREE_PROP_TREEINFO_ARCH + sizeof("treeinfo-")))
4c949f
+                             OSINFO_TREE_PROP_TREEINFO_ARCH + strlen("treeinfo-")))
4c949f
             osinfo_entity_set_param(OSINFO_ENTITY(tree),
4c949f
                                     OSINFO_TREE_PROP_TREEINFO_ARCH,
4c949f
                                     (const gchar *)nodes[i]->children->content);
4c949f
-- 
4c949f
2.21.0
4c949f