[PATCH] sctp: Replace zero-length array with flexible array member

Thorsten Blum posted 1 patch 5 days, 18 hours ago
include/linux/sctp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] sctp: Replace zero-length array with flexible array member
Posted by Thorsten Blum 5 days, 18 hours ago
Replace the deprecated zero-length array with a modern flexible array
member in the struct sctp_idatahdr.

Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 include/linux/sctp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 836a7e200f39..19eaaf3948ed 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -239,7 +239,7 @@ struct sctp_idatahdr {
 		__u32 ppid;
 		__be32 fsn;
 	};
-	__u8 payload[0];
+	__u8 payload[];
 };
 
 struct sctp_idata_chunk {
-- 
2.47.0
Re: [PATCH] sctp: Replace zero-length array with flexible array member
Posted by Kees Cook 5 days, 5 hours ago
On Sat, Nov 16, 2024 at 05:28:24PM +0100, Thorsten Blum wrote:
> Replace the deprecated zero-length array with a modern flexible array
> member in the struct sctp_idatahdr.
> 
> Link: https://github.com/KSPP/linux/issues/78
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Nothing actually uses "payload" so it could probably just be entirely
removed, but yes, this looks like a no-op change.

Reviewed-by: Kees Cook <kees@kernel.org>

-- 
Kees Cook