summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2008-03-30 09:35:04 +0000
committerdfr <dfr@FreeBSD.org>2008-03-30 09:35:04 +0000
commit6eacca7a0604581cc5603356fc594eac85e92add (patch)
tree2c38ba886ad063a40fc9f78675a159dcfe65ebc1
parent19447c2a3ed6740947af4a3f31d0941062254439 (diff)
downloadFreeBSD-src-6eacca7a0604581cc5603356fc594eac85e92add.zip
FreeBSD-src-6eacca7a0604581cc5603356fc594eac85e92add.tar.gz
Don't assume that there is readable data on the stream after the
fragment header.
-rw-r--r--lib/libc/xdr/xdr_rec.c6
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,
OpenPOWER on IntegriCloud