When copying a NAT rule struct to userland for save by ipfs, use the

length of the struct in memmove() rather than an unintialized variable.
This fixes the first of two kernel page faults when ipfs is invoked.

PR:		235110
Reported by:	David.Boyd49@twc.com
MFC after:	2 weeks
This commit is contained in:
Cy Schubert 2019-01-30 20:22:33 +00:00
parent 9c812c8d4e
commit b63abbf63a

View File

@ -1866,7 +1866,7 @@ ipf_nat_getent(softc, data, getlock)
*/
if (nat->nat_ptr != NULL)
bcopy((char *)nat->nat_ptr, (char *)&ipn->ipn_ipnat,
ipn->ipn_ipnat.in_size);
sizeof(nat->nat_ptr));
/*
* If we also know the NAT entry has an associated filter rule,