mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
pipe: keep uio_iovcnt consistent
In pipe_build_write_buffer we increment uio_iov but did not update uio_iovcnt. This would not cause an OOB read (thanks to to uio_resid) but is inconsistent and could be an issue if other code changes are made in the future. Reported by: Synacktiv Reviewed by: jhb, markj, brooks Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45999
This commit is contained in:
parent
ad0d39ecc9
commit
d8ff42e816
1 changed files with 3 additions and 1 deletions
|
|
@ -941,8 +941,10 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio *uio)
|
|||
|
||||
uio->uio_iov->iov_len -= size;
|
||||
uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + size;
|
||||
if (uio->uio_iov->iov_len == 0)
|
||||
if (uio->uio_iov->iov_len == 0) {
|
||||
uio->uio_iov++;
|
||||
uio->uio_iovcnt--;
|
||||
}
|
||||
uio->uio_resid -= size;
|
||||
uio->uio_offset += size;
|
||||
return (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue