Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163361321
D18623.id52842.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
677 B
Referenced Files
None
Subscribers
None
D18623.id52842.diff
View Options
Index: sys/kern/kern_sendfile.c
===================================================================
--- sys/kern/kern_sendfile.c
+++ sys/kern/kern_sendfile.c
@@ -1007,8 +1007,18 @@
uap->nbytes, &sbytes, uap->flags, td);
fdrop(fp, td);
- if (uap->sbytes != NULL)
- copyout(&sbytes, uap->sbytes, sizeof(off_t));
+ if (uap->sbytes != NULL) {
+ int copyout_error;
+
+ copyout_error = copyout(&sbytes, uap->sbytes, sizeof(off_t));
+ /*
+ * Ensure that copyout's success doesn't mask an existing
+ * error,
+ *
+ * copyout(9) failing should be a rare occurrence.
+ */
+ error = copyout_error != 0 ? copyout_error : error;
+ }
out:
free(hdr_uio, M_IOV);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 12:30 PM (16 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35402030
Default Alt Text
D18623.id52842.diff (677 B)
Attached To
Mode
D18623: Address the fact that errors from `copyout(9)` are not properly percolated up on failure
Attached
Detach File
Event Timeline
Log In to Comment