mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-18 22:30:07 +01:00
Avoid false positive for static scan (integer overflow).
Avoid adding signed type to unsigned one.
This commit is contained in:
@@ -1427,7 +1427,8 @@ static int reencrypt_add_single_token_keyslots(struct crypt_device *cd,
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
count += r;
|
||||
if (r > 0)
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
@@ -1450,7 +1451,8 @@ static int reencrypt_add_token_keyslots_for_unlock(struct crypt_device *cd,
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
count += r;
|
||||
if (r > 0)
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
Reference in New Issue
Block a user