diff options
author | Jose <jose@zeroc.com> | 2017-01-02 19:47:42 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-01-02 19:47:42 +0100 |
commit | de80fa17be82874a6c79f4efaf0e98c5457416c8 (patch) | |
tree | 3a8334d464afc5255751d9a8f218ec2a12ceb76f /cpp/src/Ice/OpaqueEndpointI.cpp | |
parent | Fixed (ICE-7477) - Use native Base64 encode/decode (diff) | |
download | ice-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.cpp | 20 |
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; } |