commit: 0501fd2dfe83fc29d44a5b45586fef33e63800f5
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 22 19:42:24 2020 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Jan 22 19:42:24 2020 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0501fd2d
libq/dep: fix Coverity 125901 Explicit null dereferenced
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
libq/dep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libq/dep.c b/libq/dep.c
index 0507326..3667ae5 100644
--- a/libq/dep.c
+++ b/libq/dep.c
@@ -178,7 +178,7 @@ dep_grow_tree(const char *depend)
break;
_maybe_consume_word(DEP_NORM);
- if (curr_node->parent == NULL) {
+ if (curr_node == NULL || curr_node->parent == NULL) {
warnf("Group lacks a parent");
goto error_out;
}