Skip to contentSkip to conversation

smb: Replace one-element array with flexible-array member

PATCH Applied Gustavo A. R. Silva 4 participants 5 messages Jun 21, 2023 – Jun 24, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb: Replace one-element array with flexible-array member

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct smb_negotiate_req.

This results in no differences in binary output.

---
 fs/smb/server/smb_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/server/smb_common.h +1 -1
index 6b0d5f1fe85c..aeca0f46068f 100644
@@ -200,7 +200,7 @@ struct smb_hdr {
 struct smb_negotiate_req {
 	struct smb_hdr hdr;     /* wct = 0 */
 	__le16 ByteCount;
-	unsigned char DialectsArray[1];
+	unsigned char DialectsArray[];
 } __packed;
 
 struct smb_negotiate_rsp {
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Gustavo A. R. Silva

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct smb_negotiate_req.

This results in no differences in binary output.

Signature · 1 line
Kees Cook
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Gustavo A. R. Silva

2023-06-22 6:12 GMT+09:00, Gustavo A. R. Silva <[email protected]>:

Quoted 9 lines

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct smb_negotiate_req.

This results in no differences in binary output.

Thanks!

reviewer Reviewed-by on v1 1/1
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 9 lines · Gustavo A. R. Silva

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct smb_negotiate_req.

This results in no differences in binary output.

maintainer Applied
#4 lore raw
In reply to Gustavo A. R. Silva

2023-06-22 6:12 GMT+09:00, Gustavo A. R. Silva <[email protected]>:

Quoted 9 lines

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct smb_negotiate_req.

This results in no differences in binary output.

Applied it with reviewed/acked-by tags to #ksmbd-for-next-next.

Thanks.