diff options
author | krw <krw@openbsd.org> | 2020-06-22 11:30:23 +0000 |
---|---|---|
committer | krw <krw@openbsd.org> | 2020-06-22 11:30:23 +0000 |
commit | dfec937e4b11c739b114bd6b95c37ea6ed457aa9 (patch) | |
tree | dbfd095f512d20bb33905351b0911700cedda0e0 | |
parent | drm/amdgpu: Sync with VM root BO when switching VM to CPU update mode (diff) | |
download | wireguard-openbsd-dfec937e4b11c739b114bd6b95c37ea6ed457aa9.tar.xz wireguard-openbsd-dfec937e4b11c739b114bd6b95c37ea6ed457aa9.zip |
Don't pass a pointer to an uninitialized variable as plenp to
ip6_hopopts(). The value is tested and non-zero values could cause a
packet to be discarded.
Initialize the pointed at variable to 0, tweaking variable names and
associated comments.
COVERITY 1453098
ok deraadt@ mpi@
-rw-r--r-- | sys/netinet6/ip6_output.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 219080d5c7a..a4c5c816e54 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.245 2019/11/29 16:41:01 nayden Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.246 2020/06/22 11:30:23 krw Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -600,13 +600,13 @@ reroute: */ if (exthdrs.ip6e_hbh) { struct ip6_hbh *hbh = mtod(exthdrs.ip6e_hbh, struct ip6_hbh *); - u_int32_t dummy1; /* XXX unused */ - u_int32_t dummy2; /* XXX unused */ + u_int32_t rtalert; /* returned value is ignored */ + u_int32_t plen = 0; /* no more than 1 jumbo payload option! */ m->m_pkthdr.ph_ifidx = ifp->if_index; if (ip6_process_hopopts(m, (u_int8_t *)(hbh + 1), ((hbh->ip6h_len + 1) << 3) - sizeof(struct ip6_hbh), - &dummy1, &dummy2) < 0) { + &rtalert, &plen) < 0) { /* m was already freed at this point */ error = EINVAL;/* better error? */ goto done; |