diff options
author | dzwdz | 2024-08-17 17:10:04 +0200 |
---|---|---|
committer | dzwdz | 2024-08-17 17:10:04 +0200 |
commit | 2ea826b428246eb62be81630f441a4367a675968 (patch) | |
tree | f2bb2c528f3e496efed741c5ecdfd4f922547067 /src/kernel/vfs/request.c | |
parent | 3609248bab04e0d273bb58d2544034b3ed7c35e0 (diff) |
*: getxattr
Diffstat (limited to 'src/kernel/vfs/request.c')
-rw-r--r-- | src/kernel/vfs/request.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); |