Commit 35512f4e authored by Ondrej Kozina's avatar Ondrej Kozina Committed by Milan Broz

cryptsetup-reencrypt: internal safeguard against mistakes

parent e55f10a8
......@@ -1179,6 +1179,11 @@ static int initialize_context(struct reenc_ctx *rc, const char *device)
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)))
return -ENOMEM;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment