From 2ea826b428246eb62be81630f441a4367a675968 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 17 Aug 2024 17:10:04 +0200 Subject: *: getxattr --- src/kernel/vfs/request.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/kernel/vfs') diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c index 9b60080..50fcc22 100644 --- a/src/kernel/vfs/request.c +++ b/src/kernel/vfs/request.c @@ -151,8 +151,12 @@ vfsback_useraccept(VfsReq *req) assert(!(req->kin && req->uin)); if (req->kin) { void __user *buf = handler->awaited_req.buf; - len = min(req->kinlen, handler->awaited_req.max_len); - pcpy_to(handler, buf, req->kin, len); + if (req->kinlen+1 <= handler->awaited_req.max_len) { + len = req->kinlen; + pcpy_to(handler, buf, req->kin, len+1); /* +1 for NUL */ + } else { + panic_unimplemented(); // TODO! fail + } } else if (req->uin) { void __user *buf = handler->awaited_req.buf; len = min(req->uinlen, handler->awaited_req.max_len); -- cgit v1.2.3