mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +01:00
Check exit value for snprintf where it makes sense.
This commit is contained in:
@@ -2399,9 +2399,11 @@ static int reencrypt_init(struct crypt_device *cd,
|
||||
}
|
||||
|
||||
if (!cipher_mode || *cipher_mode == '\0')
|
||||
snprintf(_cipher, sizeof(_cipher), "%s", cipher);
|
||||
r = snprintf(_cipher, sizeof(_cipher), "%s", cipher);
|
||||
else
|
||||
snprintf(_cipher, sizeof(_cipher), "%s-%s", cipher, cipher_mode);
|
||||
r = snprintf(_cipher, sizeof(_cipher), "%s-%s", cipher, cipher_mode);
|
||||
if (r < 0 || (size_t)r >= sizeof(_cipher))
|
||||
return -EINVAL;
|
||||
|
||||
if (MISALIGNED(params->data_shift, sector_size >> SECTOR_SHIFT)) {
|
||||
log_err(cd, _("Data shift is not aligned to requested encryption sector size (%" PRIu32 " bytes)."), sector_size);
|
||||
|
||||
Reference in New Issue
Block a user