Make execve(2) require 1 <= argc.
This commit is contained in:
parent
aa7c6855f7
commit
d41beab4a8
1 changed files with 3 additions and 0 deletions
|
@ -850,6 +850,9 @@ int Process::Execute(const char* programname, const uint8_t* program,
|
||||||
assert(envc != INT_MAX);
|
assert(envc != INT_MAX);
|
||||||
assert(CurrentProcess() == this);
|
assert(CurrentProcess() == this);
|
||||||
|
|
||||||
|
if ( argc == 0 )
|
||||||
|
return errno = EINVAL, -1;
|
||||||
|
|
||||||
char* programname_clone = String::Clone(programname);
|
char* programname_clone = String::Clone(programname);
|
||||||
if ( !programname_clone )
|
if ( !programname_clone )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue