diff mbox series

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

Message ID CAHC9VhRsSydnMg3uYf9bjXtmP+zydTHxTJzNYygBREpN0s4Lmw@mail.gmail.com (mailing list archive)
State Handled Elsewhere
Headers show
Series None | expand

Commit Message

Paul Moore Dec. 16, 2021, 11:16 p.m. UTC
Forwarding this to the linux-audit mailing list.

---------- Forwarded message ---------
From: Xiu Jianfeng <xiujianfeng@huawei.com>
Date: Wed, Dec 15, 2021 at 9:08 PM
Subject: [PATCH -next, v3 2/2] audit: replace zero-length array with
flexible-array member
To: <paul@paul-moore.com>, <eparis@redhat.com>,
<keescook@chromium.org>, <gustavoars@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-hardening@vger.kernel.org>


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(-)

--
2.17.1
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_ */