Arnd Bergmann be54803be8 ksmbd: avoid field overflow warning
[ Upstream commit 9cedc58bdbe9fff9aacd0ca19ee5777659f28fd7 ]

clang warns about a possible field overflow in a memcpy:

In file included from fs/smb/server/smb_common.c:7:
include/linux/fortify-string.h:583:4: error: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
                        __write_overflow_field(p_size_field, size);

It appears to interpret the "&out[baselen + 4]" as referring to a single
byte of the character array, while the equivalen "out + baselen + 4" is
seen as an offset into the array.

I don't see that kind of warning elsewhere, so just go with the simple
rework.

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-19 16:21:44 +02:00
..
2023-06-21 16:01:02 +02:00
2022-09-24 07:00:00 +02:00
2023-07-19 16:21:03 +02:00
2022-10-10 19:45:17 -07:00
2023-07-19 16:21:44 +02:00
2023-05-11 23:03:05 +09:00
2022-09-11 20:26:07 -07:00
2023-02-22 12:59:46 +01:00
2022-09-24 07:00:00 +02:00
2022-08-20 11:34:33 -04:00
2022-10-10 19:45:17 -07:00
2022-10-10 14:21:11 -07:00
2022-08-03 10:35:43 -07:00
2023-01-04 11:29:01 +01:00