execcmd::backtick: check that command is not empty
This commit is contained in:
parent
d3c0a9ddad
commit
030a304e95
1 changed files with 4 additions and 0 deletions
|
@ -1007,6 +1007,10 @@ bool ExecCmd::maybereap(int *status)
|
||||||
// Static
|
// Static
|
||||||
bool ExecCmd::backtick(const vector<string> cmd, string& out)
|
bool ExecCmd::backtick(const vector<string> cmd, string& out)
|
||||||
{
|
{
|
||||||
|
if (cmd.empty()) {
|
||||||
|
LOGERR(("ExecCmd::backtick: empty command\n"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
vector<string>::const_iterator it = cmd.begin();
|
vector<string>::const_iterator it = cmd.begin();
|
||||||
it++;
|
it++;
|
||||||
vector<string> args(it, cmd.end());
|
vector<string> args(it, cmd.end());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue