MR-872: Prevent outofbounds ex parsing args

This commit is contained in:
Sean Kaim
2016-06-21 15:30:07 -04:00
parent ba7608602b
commit 6779a02cf9
2 changed files with 2 additions and 5 deletions

View File

@@ -42,6 +42,7 @@
Fixes:
------
MR-872: Crash in External Tools when arguments aren't quoted
MR-854: crashes when right clicking on connection tab
MR-852: Option "Allow only a single instance of the application" non-functional
MR-836: Trying to delete a folder of connections only deletes 2 connections at a time

View File

@@ -124,11 +124,7 @@ namespace mRemoteNG.Tools
if (haveReplacement)
{
char trailing = '\0';
if (tokenEnd + 2 <= input.Length)
trailing = input.Substring(tokenEnd + 1, 1).ToCharArray()[0];
else
trailing = string.Empty.ToCharArray()[0];
var trailing = tokenEnd + 2 <= input.Length ? input.Substring(tokenEnd + 1, 1).ToCharArray()[0] : '\0';
if (escape == EscapeType.All)
{