Kernel: count the null byte while calculating how much stack space argv will use
This commit is contained in:
parent
23b12d2d56
commit
a4e430d35e
@ -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 >
|
||||
|
Loading…
Reference in New Issue
Block a user