Skip to contentSkip to conversation

fs/affs: struct affs_head: Replace 1-element array with flexible array

PATCH In review Kees Cook 2 participants 2 messages Jul 10, 2024

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 fs/affs: struct affs_head: Replace 1-element array with flexible array

AFFS uses struct affs_head's "table" array as a flexible array. Switch this to a proper flexible array[1]. There are no sizeof() uses; struct affs_head is only ever uses via direct casts. No binary output differences were found after this change.

---
Cc: David Sterba <[email protected]>
Cc: [email protected]

---
 fs/affs/amigaffs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/affs/amigaffs.h +1 -1
index 5509fbc98bc0..09dc23a644df 100644
@@ -80,7 +80,7 @@ struct affs_head {
 	__be32 spare1;
 	__be32 first_data;
 	__be32 checksum;
-	__be32 table[1];
+	__be32 table[];
 };
 
 struct affs_tail {
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Kees Cook

AFFS uses struct affs_head's "table" array as a flexible array. Switch this to a proper flexible array[1]. There are no sizeof() uses; struct affs_head is only ever uses via direct casts. No binary output differences were found after this change.

Thanks

Signature · 1 line
Gustavo
Quoted 20 lines

---
Cc: David Sterba <[email protected]>
Cc: [email protected]

---
  fs/affs/amigaffs.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/affs/amigaffs.h +1 -1
index 5509fbc98bc0..09dc23a644df 100644
@@ -80,7 +80,7 @@ struct affs_head {
  	__be32 spare1;
  	__be32 first_data;
  	__be32 checksum;
-	__be32 table[1];
+	__be32 table[];
  };
 
  struct affs_tail {