git: a8d8bf4affa9 - main - sendfile: if sendfile_getobj() fails jump to the function epilogue
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 10 Dec 2025 21:56:46 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=a8d8bf4affa95d3939442a65ea5c8f73785903e5
commit a8d8bf4affa95d3939442a65ea5c8f73785903e5
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-12-10 21:56:14 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-12-10 21:56:14 +0000
sendfile: if sendfile_getobj() fails jump to the function epilogue
The functional change here is that *sent would be zeroed. Note that some
portable applications, e.g. OpenSSL, use a wrapper around our sendfile(2)
to make it more Linux-like. These wrappers are usually written in a
manner that expects *sbytes to always be initialized regardless of the
error code returned.
---
sys/kern/kern_sendfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index 7ffb09c58b9c..6e924f70b2ab 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -735,7 +735,7 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio,
error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize);
if (error != 0)
- return (error);
+ goto out;
error = sendfile_getsock(td, sockfd, &sock_fp, &so);
if (error != 0)