]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
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)
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

index 7dc1318d1dc7593d2a5afec12cc73f3cf061d45f..8015610b59e1f8da4fa3f1ef9a3203d30348b63c 100644 (file)
@@ -253,7 +253,7 @@ lint:scan-build:
   script:
     - export SCANBUILD="$(realpath ./scripts/run-scanbuild-with-args.sh)"
     - ninja -C build_ci* scan-build || true
-    - test "$(ls build_ci*/meson-logs/scanbuild/*/report-*.html | wc -l)" = 21 # we have this many errors ATM :-)
+    - test "$(ls build_ci*/meson-logs/scanbuild/*/report-*.html | wc -l)" = 24 # we have this many errors ATM :-)
 
 lint:tidy:
   <<: *after_build