summaryrefslogtreecommitdiff
path: root/src/shared/dissect-image.c
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2019-02-20 21:24:33 -0300
committerFelipe Sateler <fsateler@debian.org>2019-02-20 21:24:33 -0300
commit7c20daf69c4411979b7f8902f3601d1cdc56cc07 (patch)
treed59b9989ce55ed23693e80974d94c856f1c2c8b1 /src/shared/dissect-image.c
parent6e866b331d7cd4a5e0759dd160dea6edabd3678e (diff)
downloadsystemd-7c20daf69c4411979b7f8902f3601d1cdc56cc07.tar.gz
New upstream version 241upstream/241
Diffstat (limited to 'src/shared/dissect-image.c')
-rw-r--r--src/shared/dissect-image.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index 3a46faf769..d340487025 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -1178,7 +1178,6 @@ int dissected_image_decrypt_interactively(
#if HAVE_LIBCRYPTSETUP
static int deferred_remove(DecryptedPartition *p) {
-
struct dm_ioctl dm = {
.version = {
DM_VERSION_MAJOR,
@@ -1199,6 +1198,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))