diff options
Diffstat (limited to 'src/shared/dissect-image.c')
-rw-r--r-- | src/shared/dissect-image.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index ee55bb4fef..df0c584621 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -1179,7 +1179,6 @@ int dissected_image_decrypt_interactively( #if HAVE_LIBCRYPTSETUP static int deferred_remove(DecryptedPartition *p) { - struct dm_ioctl dm = { .version = { DM_VERSION_MAJOR, @@ -1200,6 +1199,9 @@ static int deferred_remove(DecryptedPartition *p) { if (fd < 0) return -errno; + if (strlen(p->name) > sizeof(dm.name)) + return -ENAMETOOLONG; + strncpy(dm.name, p->name, sizeof(dm.name)); if (ioctl(fd, DM_DEV_REMOVE, &dm)) |