summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/OpaqueEndpointI.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-01-02 19:47:42 +0100
committerJose <jose@zeroc.com>2017-01-02 19:47:42 +0100
commitde80fa17be82874a6c79f4efaf0e98c5457416c8 (patch)
tree3a8334d464afc5255751d9a8f218ec2a12ceb76f /cpp/src/Ice/OpaqueEndpointI.cpp
parentFixed (ICE-7477) - Use native Base64 encode/decode (diff)
downloadice-de80fa17be82874a6c79f4efaf0e98c5457416c8.tar.bz2
ice-de80fa17be82874a6c79f4efaf0e98c5457416c8.tar.xz
ice-de80fa17be82874a6c79f4efaf0e98c5457416c8.zip
Revert "Fixed (ICE-7477) - Use native Base64 encode/decode"
This reverts commit 2df05d130ae51a65f51c593800ad722d533f5df3.
Diffstat (limited to 'cpp/src/Ice/OpaqueEndpointI.cpp')
-rw-r--r--cpp/src/Ice/OpaqueEndpointI.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/cpp/src/Ice/OpaqueEndpointI.cpp b/cpp/src/Ice/OpaqueEndpointI.cpp
index 3d63538ec56..2be3b400dcb 100644
--- a/cpp/src/Ice/OpaqueEndpointI.cpp
+++ b/cpp/src/Ice/OpaqueEndpointI.cpp
@@ -377,17 +377,19 @@ IceInternal::OpaqueEndpointI::checkOption(const string& option, const string& ar
ex.str = "no argument provided for -v option in endpoint " + endpoint;
throw ex;
}
-
- try
- {
- const_cast<vector<Byte>&>(_rawBytes) = Base64::decode(argument);
- }
- catch(const IceUtil::IllegalArgumentException& ex)
+ for(string::size_type i = 0; i < argument.size(); ++i)
{
- ostringstream os;
- os << "Invalid Base64 input in opaque endpoint `" << endpoint << "'\n" << ex;
- throw EndpointParseException(__FILE__, __LINE__, os.str());
+ if(!Base64::isBase64(argument[i]))
+ {
+ EndpointParseException ex(__FILE__, __LINE__);
+ ostringstream ostr;
+ ostr << "invalid base64 character `" << argument[i] << "' (ordinal " << static_cast<int>(argument[i])
+ << ") in endpoint " << endpoint;
+ ex.str = ostr.str();
+ throw ex;
+ }
}
+ const_cast<vector<Byte>&>(_rawBytes) = Base64::decode(argument);
return true;
}