clang-tidy: disable clang-analyzer-security.ArrayBound#18422
clang-tidy: disable clang-analyzer-security.ArrayBound#18422vszakats wants to merge 4 commits intocurl:masterfrom
clang-analyzer-security.ArrayBound#18422Conversation
|
clang-tidy 21 became really picky with "out of bounds" warnings. |
|
Can't decide if the ntlm.c ones are valid issues or false positives. |
|
Oh, it also trips on
|
|
It's almost getting out of hand... |
|
One of the less lucky toolchain updates. Hopefully it's going to be fixed in a .1 revision, perhaps something to re-verify Meanwhile trying to fix the remaining ones locally, but hitting a snag where |
content_encoding: another one
```
/Users/runner/work/curl/curl/lib/content_encoding.c:657:5: error: Out of bound access to memory preceding 'all' [clang-analyzer-security.ArrayBound,-warnings-as-errors]
657 | p[-2] = '\0';
| ^
```
Ref: https://github.com/curl/curl/actions/runs/17295803554/job/49093573741?pr=18422#step:11:40
mime.c
/Users/runner/work/curl/curl/lib/mime.c:1756:12: error: Out of bound access to memory after the end of the string literal [clang-analyzer-security.ArrayBound,-warnings-as-errors]
1756 | switch(contenttype[len]) {
| ^
https://github.com/curl/curl/actions/runs/17295955998/job/49094149140?pr=18422#step:11:127
ntlm.c
```
/Users/runner/work/curl/curl/lib/vauth/ntlm.c:414:5: error: Out of bound access to memory after the end of 'ntlmbuf' [clang-analyzer-security.ArrayBound,-warnings-as-errors]
414 | dest[2 * i] = (unsigned char)src[i];
| ^
```
https://github.com/curl/curl/actions/runs/17296813157/job/49097003881?pr=18422#step:11:157
ntlm.c more
/Users/runner/work/curl/curl/lib/vauth/ntlm.c:836:17: error: Out of bound access to memory after the end of 'ntlmbuf' [clang-analyzer-security.ArrayBound,-warnings-as-errors]
836 | unicodecpy(&ntlmbuf[size], host, hostlen / 2);
| ^~~~~~~~~~~~~
https://github.com/curl/curl/actions/runs/17296961941/job/49097574789?pr=18422#step:11:157
silence bunch more
https://github.com/curl/curl/actions/runs/17297304862/job/49098795447?pr=18422
silence bunch more 2
more odd cases in vtls.c
This reverts commit 36e08e5.
|
I think the In tests/server, it's coming up in nonsense places, and couldn't find the single line |
clang-analyzer-security.ArrayBound
It's causing false-positives with clang-tidy v21, in cases in system
headers (seen in
FD_ISSET()with macOS SDK). In some cases intests/server, there was no distinct source line that was triggering it.
Example:
Appeared after a CI image bumped llvm from v20 to v21:
false positive:
Ref: https://github.com/curl/curl/actions/runs/17289458226/job/49073168175#step:11:35
false positive:
Ref: https://github.com/curl/curl/actions/runs/17295803554/job/49093573741?pr=18422#step:11:40
false positive:
Ref: https://github.com/curl/curl/actions/runs/17295955998/job/49094149140?pr=18422#step:11:127
Ref: https://github.com/curl/curl/actions/runs/17296813157/job/49097003881?pr=18422#step:11:157
Ref: https://github.com/curl/curl/actions/runs/17296961941/job/49097574789?pr=18422#step:11:157