From 3a7b636f42e4694b8d3b6aa27153db6b007e1e14 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Wed, 24 Aug 2011 10:30:06 +0100 Subject: [PATCH] Fix possible out-of-bounds array access if an empty command-line argument is passed to ProcessUtils::runElevated() on Windows --- src/ProcessUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProcessUtils.cpp b/src/ProcessUtils.cpp index fa23a97..11183ce 100644 --- a/src/ProcessUtils.cpp +++ b/src/ProcessUtils.cpp @@ -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("\"");