Page MenuHomeFreeBSD

D43377.diff
No OneTemporary

D43377.diff

diff --git a/sys/kern/tty_inq.c b/sys/kern/tty_inq.c
--- a/sys/kern/tty_inq.c
+++ b/sys/kern/tty_inq.c
@@ -164,7 +164,8 @@
size_t rlen, size_t flen)
{
- MPASS(rlen <= uio->uio_resid);
+ /* rlen includes flen, flen bytes will be trimmed from the end. */
+ MPASS(rlen - flen <= uio->uio_resid);
while (rlen > 0) {
int error;
@@ -191,6 +192,14 @@
MPASS(clen >= flen);
rlen -= clen;
+ /*
+ * Caller shouldn't request that we trim anything if we might be
+ * reading across blocks. We could handle it, but today we do
+ * not.
+ */
+ if (flen > 0)
+ MPASS(rlen == 0);
+
/*
* We can prevent buffering in some cases:
* - We need to read the block until the end.

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 10:31 AM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14556899
Default Alt Text
D43377.diff (703 B)

Event Timeline