From b0b8660132253dbcfabb82f792f6ff80367b4344 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 30 Sep 2013 09:35:22 -0700 Subject: [PATCH] IPEndpoint better parsing --- beast/net/impl/IPEndpoint.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beast/net/impl/IPEndpoint.cpp b/beast/net/impl/IPEndpoint.cpp index dd4bc3eea..ffa2bf77b 100644 --- a/beast/net/impl/IPEndpoint.cpp +++ b/beast/net/impl/IPEndpoint.cpp @@ -197,10 +197,10 @@ IPEndpoint& IPEndpoint::operator= (IPEndpoint const& other) IPEndpoint IPEndpoint::from_string (std::string const& s) { - std::stringstream ss (s); + std::stringstream is (s); IPEndpoint ep; - ss >> ep; - if (! ss.fail()) + is >> ep; + if (! is.fail() && is.rdbuf()->in_avail() == 0) return ep; return IPEndpoint(); }