]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: fix compilation warning
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Dec 2022 09:18:10 +0000 (10:18 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Dec 2022 09:33:44 +0000 (10:33 +0100)
commitafd3b826fea47f512513bdb359c947c64fb59f0d
tree96be8850aeb6e04860654fbe5270cc78cdd63844
parent6c0853b770a449103878a9fd32373e90fa5c6be2
evaluate: fix compilation warning

Set pointer to list of expression to NULL and check that it is set on
before using it.

In function ‘expr_evaluate_concat’,
    inlined from ‘expr_evaluate’ at evaluate.c:2488:10:
evaluate.c:1338:20: warning: ‘expressions’ may be used uninitialized [-Wmaybe-uninitialized]
 1338 |                 if (runaway) {
      |                    ^
evaluate.c: In function ‘expr_evaluate’:
evaluate.c:1321:33: note: ‘expressions’ was declared here
 1321 |         const struct list_head *expressions;
      |                                 ^~~~~~~~~~~

Reported-by: Florian Westphal <fw@strlen.de>
Fixes: 508f3a270531 ("netlink: swap byteorder of value component in concatenation of intervals")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c