mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-22 16:20:01 +01:00
cryptsetup-reencrypt: internal safeguard against mistakes
This commit is contained in:
committed by
Milan Broz
parent
e55f10a8f1
commit
35512f4ee9
@@ -1179,6 +1179,11 @@ static int initialize_context(struct reenc_ctx *rc, const char *device)
|
|||||||
|
|
||||||
rc->log_fd = -1;
|
rc->log_fd = -1;
|
||||||
|
|
||||||
|
if (crypt_keyslot_max(CRYPT_LUKS2) > MAX_SLOT) {
|
||||||
|
log_dbg("Internal error");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(rc->device = strndup(device, PATH_MAX)))
|
if (!(rc->device = strndup(device, PATH_MAX)))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user