]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
dnstap: avoid a false-positive warning
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 3 May 2021 17:53:35 +0000 (19:53 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 9 Aug 2021 06:28:40 +0000 (08:28 +0200)
commit666947db27e6d85b577576ec887c721df64a5980
treeecb38c273238a4e707d958ac75c2c28437eeb320
parent1dd6fdb84d7ca9a9a37994bb36afe95231524147
dnstap: avoid a false-positive warning

../modules/dnstap/dnstap.c: In function 'dnstap_config':
../modules/dnstap/dnstap.c:410:29: warning: 'strndup' specified bound 4096 exceeds source size 17 [-Wstringop-overread]
  410 |                 sock_path = strndup(DEFAULT_SOCK_PATH, PATH_MAX);
      |                             ^
../modules/dnstap/dnstap.c:423:37: warning: 'strndup' specified bound 4096 exceeds source size 17 [-Wstringop-overread]
  423 |                         sock_path = strndup(DEFAULT_SOCK_PATH, PATH_MAX);
      |                                     ^

We don't need to restrict our built-in path defaults to PATH_MAX
characters, as they just can't be that long and it's not an issue if we
shoot over it anyway - opening such a file would only fail.
modules/dnstap/dnstap.c