mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
mld6: initialize oifp to avoid bogus results/panics in edge cases
In certain cases (probably not during normal operation but observed in the lab during development) ip6_ouput() could return without error and ifpp (&oifp) not updated. Given oifp was never initialized we would take the later branch as oifp was not NULL, and when calling icmp6_ifstat_inc() we would panic dereferencing a garbage pointer. For code stability initialize oifp to NULL before first use to always have a deterministic value and not rely on a called function to behave and always and for ever do the work for us as we hope for. MFC after: 3 days Sponsored by: Netflix
This commit is contained in:
parent
3f9309e571
commit
f1db666a61
1 changed files with 1 additions and 0 deletions
|
|
@ -3159,6 +3159,7 @@ mld_dispatch_packet(struct mbuf *m)
|
|||
mld = (struct mld_hdr *)(mtod(md, uint8_t *) + off);
|
||||
type = mld->mld_type;
|
||||
|
||||
oifp = NULL;
|
||||
error = ip6_output(m0, &mld_po, NULL, IPV6_UNSPECSRC, &im6o,
|
||||
&oifp, NULL);
|
||||
if (error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue