Explorar o código

limit vfs_read buffer size when doing system calls

greatbridf %!s(int64=2) %!d(string=hai) anos
pai
achega
576ca427b0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/kernel/syscall.cpp

+ 1 - 1
src/kernel/syscall.cpp

@@ -104,7 +104,7 @@ void _syscall_read(interrupt_stack* data)
     }
 
     // TODO: copy to user function !IMPORTANT
-    int n_wrote = fs::vfs_read(file->impl.ind, buf, 0U - 1, file->cursor, n);
+    int n_wrote = fs::vfs_read(file->impl.ind, buf, n, file->cursor, n);
     file->cursor += n_wrote;
     SYSCALL_SET_RETURN_VAL(n_wrote, 0);
 }