diff options
author | dfr <dfr@FreeBSD.org> | 2008-03-30 09:35:04 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2008-03-30 09:35:04 +0000 |
commit | 6eacca7a0604581cc5603356fc594eac85e92add (patch) | |
tree | 2c38ba886ad063a40fc9f78675a159dcfe65ebc1 /lib/libc/xdr | |
parent | 19447c2a3ed6740947af4a3f31d0941062254439 (diff) | |
download | FreeBSD-src-6eacca7a0604581cc5603356fc594eac85e92add.zip FreeBSD-src-6eacca7a0604581cc5603356fc594eac85e92add.tar.gz |
Don't assume that there is readable data on the stream after the
fragment header.
Diffstat (limited to 'lib/libc/xdr')
-rw-r--r-- | lib/libc/xdr/xdr_rec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c index a50d141..34238ed 100644 --- a/lib/libc/xdr/xdr_rec.c +++ b/lib/libc/xdr/xdr_rec.c @@ -574,6 +574,12 @@ __xdrrec_getrec(xdrs, statp, expectdata) rstrm->in_header &= ~LAST_FRAG; rstrm->last_frag = TRUE; } + /* + * We can only reasonably expect to read once from a + * non-blocking stream. Reading the fragment header + * may have drained the stream. + */ + expectdata = FALSE; } n = rstrm->readit(rstrm->tcp_handle, |