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