mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Fix buffer allocation size for uuid string
We have 3 components and traling '\0' so allocate proper room for all of them. Problem was nicely hidden by allocation from pool and allocation aligment offset - so to trigger real problem with this one is actually hard.
This commit is contained in:
parent
218f657794
commit
c9c1730705
@ -1,5 +1,6 @@
|
||||
Version 2.02.85 -
|
||||
===================================
|
||||
Fix buffer allocation in build_dm_uuid().
|
||||
Fix readlink usage inside get_primary_dev().
|
||||
Use format instance mempool where possible and adequate.
|
||||
Call destroy_instance for any PVs found in VG structure during vg_free call.
|
||||
|
@ -229,7 +229,7 @@ char *build_dm_uuid(struct dm_pool *mem, const char *lvid, const char *layer)
|
||||
if (!layer)
|
||||
layer = "";
|
||||
|
||||
len = sizeof(UUID_PREFIX) + strlen(lvid) + strlen(layer) + 1;
|
||||
len = sizeof(UUID_PREFIX) + strlen(lvid) + strlen(layer) + 1 + 1;
|
||||
|
||||
if (!(dmuuid = dm_pool_alloc(mem, len))) {
|
||||
log_error("build_dm_name: Allocation failed for %" PRIsize_t
|
||||
|
Loading…
x
Reference in New Issue
Block a user