diff mbox series

[-next,v3,2/2] audit: replace zero-length array with flexible-array member

Message ID 20211217010152.61796-2-xiujianfeng@huawei.com (mailing list archive)
State Mainlined
Commit ed98ea2128b6fd83bce13716edf8f5fe6c47f574
Headers show
Series [-next,v3,1/2] audit: use struct_size() helper in audit_[send|make]_reply() | expand

Commit Message

xiujianfeng Dec. 17, 2021, 1:01 a.m. UTC
Zero-length arrays are deprecated and should be replaced with
flexible-array members.

Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 include/uapi/linux/audit.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Moore Dec. 20, 2021, 9:20 p.m. UTC | #1
On Thu, Dec 16, 2021 at 8:01 PM Xiu Jianfeng <xiujianfeng@huawei.com> wrote:
>
> Zero-length arrays are deprecated and should be replaced with
> flexible-array members.
>
> Link: https://github.com/KSPP/linux/issues/78
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
> ---
>  include/uapi/linux/audit.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

It doesn't look like this shouldn't impact the UAPI so I've also
merged into audit/next, thanks!
diff mbox series

Patch

diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 9176a095fefc..8eda133ca4c1 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -514,7 +514,7 @@  struct audit_rule_data {
 	__u32		values[AUDIT_MAX_FIELDS];
 	__u32		fieldflags[AUDIT_MAX_FIELDS];
 	__u32		buflen;	/* total length of string fields */
-	char		buf[0];	/* string fields buffer */
+	char		buf[];	/* string fields buffer */
 };
 
 #endif /* _UAPI_LINUX_AUDIT_H_ */