Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Fix possible crash when opening the msn news page
Browse files Browse the repository at this point in the history
  • Loading branch information
sylveon committed Mar 11, 2018
1 parent 1c4c345 commit 19f10c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Edge2Browser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ static void Main(string[] CommandLine)
if (!new string[] {"http://", "https://"}.Any(ValidProtocol => LaunchURL.StartsWith(ValidProtocol, StringComparison.OrdinalIgnoreCase)))
LaunchURL = "http://" + LaunchURL; // If there isn't a valid URL prefix, add one to prevent launching an arbitrary exe. (Or someone calling the protocol like this: "microsoft-edge:google.com")

if (Uri.IsWellFormedUriString(LaunchURL, UriKind.Absolute))
LaunchInternetURL(LaunchURL);
Uri url;
if (Uri.TryCreate(LaunchURL, UriKind.Absolute, out url))
LaunchInternetURL(url.AbsoluteUri);
else
throw new UriFormatException(); // When this happens, we can get a memory dump by WER containing the CommandLine array for further analysis and bugfixing.
}
Expand Down

0 comments on commit 19f10c8

Please sign in to comment.