MFC r286862:

Fix the copy of addresses passed from userland in table replace command.

  The size2 is the maximum userland buffer size (used when the addresses are
  copied back to userland).

  Obtained from:	pfSense
  Sponsored by:	Rubicon Communications (Netgate)
This commit is contained in:
loos 2015-08-20 14:03:03 +00:00
parent 473deb7c5c
commit 33f4807b1f

View File

@ -2718,8 +2718,7 @@ DIOCCHANGEADDR_error:
error = ENODEV;
break;
}
totlen = (io->pfrio_size + io->pfrio_size2) *
sizeof(struct pfr_addr);
totlen = io->pfrio_size * sizeof(struct pfr_addr);
pfras = malloc(totlen, M_TEMP, M_WAITOK);
error = copyin(io->pfrio_buffer, pfras, totlen);
if (error) {