1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +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 9fde529762
commit c559180cca
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.70 - 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(). 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 "". Do not crash for dm_report_init() sort_key == NULL and behave like "".
Return error for failing allocation in dm_asprintf(). 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; goto out;
/* Can't recurse if not a mapped device or there are no dependencies */ /* 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)) { if (!_add_to_bottomlevel(node)) {
stack; stack;
node = NULL; node = NULL;