diff options
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); |