Kernel: count the null byte while calculating how much stack space argv will use

This commit is contained in:
apio 2022-10-26 20:05:24 +02:00
parent 23b12d2d56
commit a4e430d35e

View File

@ -166,7 +166,10 @@ void sys_execv(Context* context, const char* pathname, char** argv)
for (uint64_t i = 0; i <= kargc; i++)
{
stack_size += sizeof(char*);
if (kargv[i]) { stack_size += strlen(kargv[i]); }
if (kargv[i])
{
stack_size += strlen(kargv[i]) + 1; // count the null byte
}
}
if (stack_size >