]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
ci lint:scan-build: fix the error count
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 24 May 2023 11:05:13 +0000 (13:05 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 12 Jun 2023 08:32:57 +0000 (10:32 +0200)
commit88843bf987b7fbfa0bcb090b787250473a8150b7
tree8819c1a6bb5485f2f2a87ceade5841097d23e846
parentd553101616264492adebd0efb36264f1e5b9d363
ci lint:scan-build: fix the error count

The new reports are:
./lib/rules/api.c:301:3: warning: Memory copy function overflows destination buffer
         memcpy(key_data_ruleset_end, &KEY_EXACT_MATCH, sizeof(KEY_EXACT_MATCH));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/rules/api.c:506:2: warning: Memory copy function overflows destination buffer
 memcpy(key.data, &KEY_EXACT_MATCH, sizeof(KEY_EXACT_MATCH));
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/rules/api.c:699:2: warning: Memory copy function overflows destination buffer
 memcpy(key.data, &KEY_ZONELIKE_A, sizeof(KEY_ZONELIKE_A));
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.

I re-checked those places, and I believe they can never overflow.
I regularly run with ASAN as well, which would catch overflows.
I can't see a simple way of amending the code in a way
that the linter might be happy.
.gitlab-ci.yml