{"author":"Viktor Szakats","author_email":"commit@vsz.me","author_time":1738759926,"commit_time":1738769343,"committer":"Viktor Szakats","committer_email":"commit@vsz.me","hash":"14f26f5ee78204c15bf906f3cf7480308e2feb28","message":"smb: silence `-Warray-bounds` with gcc 13+\n\nThe code look correct. The compiler gets confused by the `byte[1]`\nstruct member mapped into a memory buffer with a variable-sized\npayload starting at this member. Perhaps there is a cleaner way\nto silence this by changing the code.\n\nFirst seen with gcc 13.2.0 in curl-for-win builds. Then with 13.2.1 and\nthe latest 14.2.0.\n\n```\ncurl/lib/smb.c: In function 'smb_connection_state':\ncurl/lib/smb.c:895:5: warning: 'memcpy' offset [74, 80] from the object at 'buf' is out of the bounds of referenced subobject 'bytes' with type 'char[1]' at offset 73 [-Warray-bounds=]\n  895 |     memcpy(smbc->challenge, nrsp->bytes, sizeof(smbc->challenge));\n      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ncurl/lib/smb.c:130:8: note: subobject 'bytes' declared here\n  130 |   char bytes[1];\n      |        ^~~~~\n```\n\ngcc 14.2.0 debian:testing musl riscv64: https://github.com/curl/curl/actions/runs/13157579253/job/36718140035?pr=16182#step:3:5576\ngcc 13.2.1 alpine amd64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797582549#step:3:4869\ngcc 13.2.0 debian:testing glibc aarch64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797581315#step:3:6054\ngcc 13.2.0 debian:testing glibc amd64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797581315#step:3:10959\ngcc 13.2.0 debian:sid glibc riscv64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797580697#step:3:6122\ngcc 13.2.0 debian:sid musl riscv64: https://github.com/curl/curl-for-win/actions/runs/9370491111/job/25797583450#step:3:6227\n\nCloses #16187\n","parents":["e4557573464ce7fd66ae8fe9723dc7c3dce1f349"],"tree_hash":"d53339736fce9af25d5b32e4149c1021a88e579f"}