Fix possible out-of-bounds array access if an empty command-line argument is passed to ProcessUtils::runElevated() on Windows

This commit is contained in:
Robert Knight 2011-08-24 10:30:06 +01:00
parent 61e7561615
commit 3a7b636f42

View file

@ -280,7 +280,7 @@ void ProcessUtils::runElevatedWindows(const std::string& executable,
{
std::string arg = *iter;
if (arg.at(0) != '"' && arg.at(arg.size()-1) != '"')
if (!arg.empty() && arg.at(0) != '"' && arg.at(arg.size()-1) != '"')
{
arg.insert(0,"\"");
arg.append("\"");