-- v3: webservices/tests: Fix -Warray-bounds warning on gcc 13.2.0.
From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/webservices/tests/channel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/webservices/tests/channel.c b/dlls/webservices/tests/channel.c index 4cf39c10732..c64027fb86d 100644 --- a/dlls/webservices/tests/channel.c +++ b/dlls/webservices/tests/channel.c @@ -1217,12 +1217,13 @@ static const char send_record_end[] = { 0x08, 0x02, 0x6e, 0x73, 0x89, 0xff, 0x01 static BOOL send_dict_str( int sock, char *addr, const char *str, int dict_str_count ) { char buf[512], dict_buf[256], body_buf[128], dict_size_buf[5]; + const int max_len = ARRAY_SIZE(dict_buf) - ARRAY_SIZE(dict_size_buf); int offset, dict_buf_size, body_buf_size, dict_size;
/* Session dictionary strings. */ - offset = write_size( dict_buf, strlen(str) ); - memcpy( dict_buf + offset, str, strlen(str) ); - dict_buf_size = strlen(str) + offset; + offset = write_size( dict_buf, strnlen(str, max_len) ); + memcpy( dict_buf + offset, str, strnlen(str, max_len) ); + dict_buf_size = strnlen( str, max_len ) + offset;
dict_size = write_size( dict_size_buf, dict_buf_size );
On Mon Mar 4 13:25:10 2024 +0000, Connor McAdams wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/5203/diffs?diff_id=102861&start_sha=d0e0c02561604577600feecf935571786ded2d50#0cca36bda912532d4e590e947a546e317cb22224_1225_1224)
I agree, changed in the current revision. Is this better?
This merge request was approved by Hans Leidekker.