cpp-netlib/uri

Assigning a default-constructed URI crashes

Closed this issue · 1 comments

Assigning a default-constructed URI to a non-default-constructed URI crashes.

TEST(uri_test, default_constructed_assignment_test) {
  network::uri instance("http://www.example.com/");
  instance = network::uri(); // <-- CRASHES HERE
  ASSERT_EQ(instance, network::uri());
}

This seems to be the case no matter what the destination URI is, so long as that URI is not empty.

Whereas, assigning a default-constructed URI to another default-constructed URI succeeds.

I added a test in the PR referenced above, it looks like this no longer an issue.