diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 618673797..4303dc9ef 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.136 - ====================================== + Check mem alloc fail in _canonicalize_field_ids(). Use unsigned math when checking more then 31 legs of raid. Fix 'dmstats delete' with dmsetup older than v1.02.129 Fix stats walk segfault with dmsetup older than v1.02.129 diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index fed79d472..ebd24391e 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -1228,7 +1228,10 @@ static int _canonicalize_field_ids(struct dm_report *rh) return_0; if (differs) { - canonical_field_dup = dm_pool_strdup(rh->mem, canonical_field); + if (!(canonical_field_dup = dm_pool_strdup(rh->mem, canonical_field))) { + log_error("_canonicalize_field_dup: dm_pool_alloc failed."); + return 0; + } rh->canonical_field_ids[i] = canonical_field_dup; } else rh->canonical_field_ids[i] = rh->fields[i].id;