Fix incorrect buffer size calculation in ProcessUtils::runAsyncUnix()

The buffer needs one entry for the executable path, args.size()
  args for the supplied arguments and one further entry for the null
  terminator.
This commit is contained in:
Robert Knight 2011-08-22 14:37:39 +01:00
parent ced6b097b4
commit 07ed391080
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ int ProcessUtils::runAsyncUnix(const std::string& executable,
if (child == 0)
{
// in child process
char** argBuffer = new char*[args.size() + 1];
char** argBuffer = new char*[args.size() + 2];
argBuffer[0] = strdup(executable.c_str());
int i = 1;
for (std::list<std::string>::const_iterator iter = args.begin(); iter != args.end(); iter++)