Author: mrowe
Date: 2004-06-22 05:41:55 +1200 (Tue, 22 Jun 2004)
New Revision: 183
Modified:
branches/libmsn-3.1.x/msn/passport.cpp
branches/libmsn-3.1.x/msn/util.cpp
Log:
Merge Passport and splitServerAddress fixes of [163] to 3.1.x branch.
Modified: branches/libmsn-3.1.x/msn/passport.cpp
===================================================================
--- branches/libmsn-3.1.x/msn/passport.cpp 2004-06-21 17:20:35 UTC (rev
182)
+++ branches/libmsn-3.1.x/msn/passport.cpp 2004-06-21 17:41:55 UTC (rev
183)
@@ -27,6 +27,9 @@
{
void Passport::validate()
{
+ if (email.find(" ") != std::string::npos)
+ throw InvalidPassport("Passport must not contain any spaces!");
+
if (email.find("@") == std::string::npos || email.find("@") !=
email.rfind("@"))
throw InvalidPassport("Passport must contain exactly one '@'
character!");
Modified: branches/libmsn-3.1.x/msn/util.cpp
===================================================================
--- branches/libmsn-3.1.x/msn/util.cpp 2004-06-21 17:20:35 UTC (rev 182)
+++ branches/libmsn-3.1.x/msn/util.cpp 2004-06-21 17:41:55 UTC (rev 183)
@@ -37,6 +37,10 @@
address = address.substr(0, pos);
port = decimalFromString(port_s);
}
+
+ if (address == "" || port < 0)
+ throw std::runtime_error("Invalid zero-length address or negative
port number!");
+
return std::make_pair(address, port);
}
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
|