Uri parsing .NET bug
Jan. 26th, 2017 09:14 amNormally, in case of invalid input Uri() code throws UriFormatException. But with really weird input Uri(baseUri, Url) overload can produce NullReferenceException:
[TestMethod]
[ExpectedException(typeof(NullReferenceException))]
public void UriFailureTest()
{
new Uri(
new Uri("https://jobs.web.cern.ch/content/cern-jobs-insight/what-are-we-doing-while-you%E2%80%99re-waiting"),
"https:/jobs.web.cern.ch/content/cern-jobs-insight/what-are-we-doing-while-you%E2%80%99re-waiting");
}
no subject
Date: 2017-01-26 05:52 pm (UTC)no subject
Date: 2017-01-26 07:12 pm (UTC)