mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Add validation of name and uuid
Do not accept NULL pointers.
This commit is contained in:
parent
2c711a2502
commit
3b5834d78b
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.70 -
|
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 "".
|
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().
|
||||||
Add missing test for failing allocation in dm_realloc() code.
|
Add missing test for failing allocation in dm_realloc() code.
|
||||||
|
@ -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 *name2;
|
||||||
const char *uuid2;
|
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? */
|
/* Do we need to add node to tree? */
|
||||||
if (!(dnode = dm_tree_find_node_by_uuid(dtree, uuid))) {
|
if (!(dnode = dm_tree_find_node_by_uuid(dtree, uuid))) {
|
||||||
if (!(name2 = dm_pool_strdup(dtree->mem, name))) {
|
if (!(name2 = dm_pool_strdup(dtree->mem, name))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user