Fix possible integer overflow (for unused variable).

This commit is contained in:
Milan Broz
2025-05-21 10:55:58 +02:00
parent 465043300d
commit 8440e59b7b

View File

@@ -3859,7 +3859,8 @@ static int reencrypt_init_by_keyslot_context(struct crypt_device *cd,
r = kc_new->get_key_size(cd, kc_new, &key_length);
else {
r = crypt_keyslot_get_key_size(cd, keyslot_new);
key_length = r;
if (r >= 0)
key_length = r;
}
if (r < 0)
return r;