1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Check for deps pointer before dererence

As _deps() call may return NULL - check for it.
This commit is contained in:
Zdenek Kabelac 2012-02-10 14:48:28 +00:00
parent 3b5834d78b
commit 4d95ccc696
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.70 -
===================================
Add pointer test for dependency check in _add_dev().
Validate name and uuid params of dm_tree_add_new_dev_with_udev_flags().
Do not crash for dm_report_init() sort_key == NULL and behave like "".
Return error for failing allocation in dm_asprintf().

View File

@ -1180,7 +1180,7 @@ static struct dm_tree_node *_add_dev(struct dm_tree *dtree,
goto out;
/* Can't recurse if not a mapped device or there are no dependencies */
if (!node->info.exists || !deps->count) {
if (!node->info.exists || !deps || !deps->count) {
if (!_add_to_bottomlevel(node)) {
stack;
node = NULL;