diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 44a656c3d..c6192568c 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.70 - =================================== + 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(). Add missing test for failing allocation in dm_realloc() code. diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 062d32da7..0b16efa2c 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -1086,6 +1086,11 @@ struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *dtree, const char *name2; const char *uuid2; + if (!name || !uuid) { + log_error("Cannot add device without name and uuid."); + return NULL; + } + /* Do we need to add node to tree? */ if (!(dnode = dm_tree_find_node_by_uuid(dtree, uuid))) { if (!(name2 = dm_pool_strdup(dtree->mem, name))) {