Made the network_address constructor do a little more input validation.

This commit is contained in:
Davis King 2012-10-21 19:01:31 -04:00
parent 56c6d33c4a
commit 0b576acd8c

View File

@ -26,7 +26,7 @@ namespace dlib
{
std::istringstream sin(full_address);
sin >> *this;
if (!sin)
if (!sin || sin.peek() != EOF)
throw invalid_network_address("invalid network address: " + full_address);
}