[libosinfo PATCH 3/3] db: improve _guess_os_from_tree checks

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

 



From: Fabiano Fidêncio <fabiano@xxxxxxxxxxxx>

Do not check against a distro that has all the treeinfo attribute as
NULL as match_regex() would just match whatever we compare to it.

Signed-off-by: Fabiano Fidêncio <fabiano@xxxxxxxxxxxx>
---
 osinfo/osinfo_db.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
index fa14c6d..bf73e25 100644
--- a/osinfo/osinfo_db.c
+++ b/osinfo/osinfo_db.c
@@ -763,6 +763,9 @@ OsinfoOs *osinfo_db_guess_os_from_tree(OsinfoDb *db,
             const gchar *os_version = osinfo_tree_get_treeinfo_version(os_tree);
             const gchar *os_arch = osinfo_tree_get_treeinfo_arch(os_tree);
 
+            if (!osinfo_tree_has_treeinfo(os_tree))
+                continue;
+
             if (match_regex(os_family, tree_family) &&
                 match_regex(os_variant, tree_variant) &&
                 match_regex(os_version, tree_version) &&
-- 
2.19.1

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux