Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102165737
D43377.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
703 B
Referenced Files
None
Subscribers
None
D43377.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D43377: kern: tty: fix ttyinq_read_uio assertion
Attached
Detach File
Event Timeline
Log In to Comment