diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2020-04-29 21:00:41 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-14 07:57:23 +0200 |
| commit | 412cb7a3fb66792f8ec30ed80e126193ad073e56 (patch) | |
| tree | e06ef3d1416de63ceca8ee4f85325055353a70d1 /scripts/decodecode | |
| parent | efc97a1dec84a0f19ad3851014e54306597f2602 (diff) | |
netfilter: nf_osf: avoid passing pointer to local var
commit c165d57b552aaca607fa5daf3fb524a6efe3c5a3 upstream.
gcc-10 points out that a code path exists where a pointer to a stack
variable may be passed back to the caller:
net/netfilter/nfnetlink_osf.c: In function 'nf_osf_hdr_ctx_init':
cc1: warning: function may return address of local variable [-Wreturn-local-addr]
net/netfilter/nfnetlink_osf.c:171:16: note: declared here
171 | struct tcphdr _tcph;
| ^~~~~
I am not sure whether this can happen in practice, but moving the
variable declaration into the callers avoids the problem.
Fixes: 31a9c29210e2 ("netfilter: nf_osf: add struct nf_osf_hdr_ctx")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/decodecode')
0 files changed, 0 insertions, 0 deletions
