diff --git a/lib/device/device_id.c b/lib/device/device_id.c index bcc703e35..f02b81e7c 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -2352,7 +2352,8 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs, if ((du->idtype == DEV_ID_TYPE_SYS_SERIAL) && du->pvid && memcmp(dev->pvid, du->pvid, ID_LEN)) { log_debug("suspect device id serial %s for %s", du->idname, dev_name(dev)); - str_list_add(cmd->mem, &cmd->device_ids_check_serial, dm_pool_strdup(cmd->mem, du->idname)); + if (!str_list_add(cmd->mem, &cmd->device_ids_check_serial, dm_pool_strdup(cmd->mem, du->idname))) + stack; *device_ids_invalid = 1; continue; } diff --git a/lib/device/filesystem.c b/lib/device/filesystem.c index 29b57d0c9..899352bcf 100644 --- a/lib/device/filesystem.c +++ b/lib/device/filesystem.c @@ -274,7 +274,8 @@ int fs_mount_state_is_misnamed(struct cmd_context *cmd, struct logical_volume *l continue; if (stme.st_dev != st_lv.st_rdev) continue; - dm_strncpy(mtab_mntpath, me->mnt_dir, sizeof(mtab_mntpath)); + if (!dm_strncpy(mtab_mntpath, me->mnt_dir, sizeof(mtab_mntpath))) + continue; /* Ignore too long unsupported paths */ break; } endmntent(fme);