]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: trace: fix warning on null dereference
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 24 May 2024 12:17:11 +0000 (14:17 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 24 May 2024 12:36:03 +0000 (14:36 +0200)
commit4e632545f74d4e53a982f907264ac752006d1e66
tree1a51950acd0c268e718452f39dd4d87556006e12
parent77c228f04fca3c85c69a63a73883893ecb0db5b6
BUILD: trace: fix warning on null dereference

Since a recent change on trace, the following compilation warning may
occur :
  src/trace.c: In function ‘trace_parse_cmd’:
  src/trace.c:865:33: error: potential null pointer dereference [-Werror=null-dereference]
    865 |                         for (nd = src->decoding; nd->name && nd->desc; nd++)
        |                              ~~~^~~~~~~~~~~~~~~

Fix this by rearranging code path to better highlight that only "quiet"
verbosity is allowed if no trace source is specified.

This was detected with GCC 14.1.
src/trace.c