]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Use ASSERT_PTR() in partition_encrypt()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 21 Nov 2022 09:45:26 +0000 (10:45 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 21 Nov 2022 09:45:26 +0000 (10:45 +0100)
src/partition/repart.c

index aa8a99fe1ac7b761c306326a874c85f4740ca04c..8249a82043d6769909a1594564c4a1fb8fcefa8e 100644 (file)
@@ -3154,8 +3154,8 @@ static int partition_target_sync(Context *context, Partition *p, PartitionTarget
 static int partition_encrypt(Context *context, Partition *p, const char *node) {
 #if HAVE_LIBCRYPTSETUP && HAVE_CRYPT_SET_DATA_OFFSET && HAVE_CRYPT_REENCRYPT_INIT_BY_PASSPHRASE && HAVE_CRYPT_REENCRYPT
         struct crypt_params_luks2 luks_params = {
-                .label = strempty(p->new_label),
-                .sector_size = context->sector_size,
+                .label = strempty(ASSERT_PTR(p)->new_label),
+                .sector_size = ASSERT_PTR(context)->sector_size,
                 .data_device = node,
         };
         struct crypt_params_reencrypt reencrypt_params = {