commit:     0c0ad25287d0f2c74c4fbfa7c72281f6169c72f7
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  7 18:00:01 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jun  7 18:00:01 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0c0ad252

qlist: fix crash in qlist_match when atom->SUBSLOT is absent

when the query has a subslot, but the package in question doesn't, don't
try to match it

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qlist.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qlist.c b/qlist.c
index 52ae77d..0299d54 100644
--- a/qlist.c
+++ b/qlist.c
@@ -245,7 +245,8 @@ qlist_match(
                if (strcmp(atom->SLOT, uslot) != 0)
                        return false;
 
-               if (usslot != NULL && strcmp(atom->SUBSLOT, usslot) != 0)
+               if (usslot != NULL &&
+                               (atom->SUBSLOT == NULL || strcmp(atom->SUBSLOT, 
usslot) != 0))
                        return false;
        }
 

Reply via email to