From c14d60c476a020d43e5856efb341ffdad426befd Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Sat, 15 Jan 2011 20:08:35 +0000 Subject: [PATCH] https://issues.shibboleth.net/jira/browse/CPPOST-61 --- saml/saml2/binding/impl/SAML2RedirectEncoder.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp b/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp index 616d98f..bb28484 100644 --- a/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp @@ -138,15 +138,18 @@ long SAML2RedirectEncoder::encode( throw BindingException("Base64 encoding of XML failed."); // Create beginnings of redirect query string. - const URLEncoder* escaper = XMLToolingConfig::getConfig().getURLEncoder(); xmlbuf.erase(); - xmlbuf.append(reinterpret_cast(encoded), xlen); + for (const XMLByte* xb = encoded; *xb; ++xb) { + if (!isspace(*xb)) + xmlbuf += *xb; + } #ifdef OPENSAML_XERCESC_HAS_XMLBYTE_RELEASE XMLString::release(&encoded); #else XMLString::release((char**)&encoded); #endif + const URLEncoder* escaper = XMLToolingConfig::getConfig().getURLEncoder(); xmlbuf = (request ? "SAMLRequest=" : "SAMLResponse=") + escaper->encode(xmlbuf.c_str()); if (relayState && *relayState) xmlbuf = xmlbuf + "&RelayState=" + escaper->encode(relayState); -- 2.1.4