diff --git a/sortix/kernelinfo.cpp b/sortix/kernelinfo.cpp index 494c069d..10f2740a 100644 --- a/sortix/kernelinfo.cpp +++ b/sortix/kernelinfo.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -54,7 +55,8 @@ static ssize_t sys_kernelinfo(const char* req, char* resp, size_t resplen) size_t stringlen = strlen(str); if ( resplen < stringlen + 1 ) return errno = ERANGE, (ssize_t) stringlen; - strcpy(resp, str); + if ( !CopyToUser(resp, str, sizeof(char) * (stringlen + 1)) ) + return -1; return 0; }