syscall fixes

This commit is contained in:
2026-10-12 19:05:42 +02:00
parent bc5f01dab6
commit 060983bbf6
5 changed files with 16 additions and 9 deletions
+8 -3
View File
@@ -19,10 +19,15 @@ enum syslog_kind : uintptr_t {
struct syscall_ret sys_syslog(enum syslog_kind kind, __user char* message, size_t len) {
struct syscall_ret ret = {};
const size_t buf_len = MIN(len + 1, 0x1000);
const size_t buf_len = MIN(len + 1, 256);
char* buf = mem_alloc(buf_len, ALLOC_NOZERO);
usercopy_read(buf, message, buf_len - 1);
buf[buf_len] = 0;
if (!usercopy_read(buf, message, buf_len - 1)) {
mem_free(buf);
ret.error = EFAULT;
return ret;
}
buf[buf_len - 1] = 0;
const char* log_level;
switch (kind) {