Skip to content

Commit 55c44cd

Browse files
committed
Fix warning for hidden global variable
The requirements_flags is a global array, do not name a local variable the same (CodeQL fix).
1 parent ca7c4c8 commit 55c44cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/luks2/luks2_json_metadata.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,7 @@ int LUKS2_activate(struct crypt_device *cd,
26612661
{
26622662
int r;
26632663
bool dynamic, read_lock, write_lock, opal_lock_on_error = false;
2664-
uint32_t opal_segment_number, requirements_flags;
2664+
uint32_t opal_segment_number, req_flags;
26652665
uint64_t range_offset_sectors, range_length_sectors, device_length_bytes;
26662666
struct luks2_hdr *hdr = crypt_get_hdr(cd, CRYPT_LUKS2);
26672667
struct crypt_dm_active_device dmdi = {}, dmd = {
@@ -2760,13 +2760,13 @@ int LUKS2_activate(struct crypt_device *cd,
27602760

27612761
dmd.flags |= flags;
27622762

2763-
if (crypt_persistent_flags_get(cd, CRYPT_FLAGS_REQUIREMENTS, &requirements_flags)) {
2763+
if (crypt_persistent_flags_get(cd, CRYPT_FLAGS_REQUIREMENTS, &req_flags)) {
27642764
r = -EINVAL;
27652765
goto out;
27662766
}
27672767

27682768
if (crypt_get_integrity_tag_size(cd) &&
2769-
!(requirements_flags & CRYPT_REQUIREMENT_INLINE_HW_TAGS)) {
2769+
!(req_flags & CRYPT_REQUIREMENT_INLINE_HW_TAGS)) {
27702770
if (!LUKS2_integrity_compatible(hdr)) {
27712771
log_err(cd, _("Unsupported device integrity configuration."));
27722772
r = -EINVAL;

0 commit comments

Comments
 (0)