X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fbinding%2Fimpl%2FSAMLArtifact.cpp;h=c3358faa33e1045e2f30439941cee6b1c1bad9bf;hp=7c50035d50895438e96ae11bb4a7fec7761f0cfa;hb=52a4b6e644370ea071381676df5fb497e8832980;hpb=c9e0e2dc2e15d2004333db7f135947db13956b5e diff --git a/saml/binding/impl/SAMLArtifact.cpp b/saml/binding/impl/SAMLArtifact.cpp index 7c50035..c3358fa 100644 --- a/saml/binding/impl/SAMLArtifact.cpp +++ b/saml/binding/impl/SAMLArtifact.cpp @@ -61,23 +61,31 @@ const unsigned int SAMLArtifact::TYPECODE_LENGTH = 2; SAMLArtifact::SAMLArtifact(const char* s) { - unsigned int len=0; + xsecsize_t len=0; XMLByte* decoded=Base64::decode(reinterpret_cast(s),&len); if (!decoded) throw ArtifactException("Unable to decode base64 artifact."); XMLByte* ptr=decoded; while (len--) m_raw+= *ptr++; +#ifdef OPENSAML_XERCESC_HAS_XMLBYTE_RELEASE XMLString::release(&decoded); +#else + XMLString::release((char**)&decoded); +#endif } string SAMLArtifact::encode() const { - unsigned int len=0; + xsecsize_t len=0; XMLByte* out=Base64::encode(reinterpret_cast(m_raw.data()),m_raw.size(),&len); if (out) { string ret(reinterpret_cast(out),len); +#ifdef OPENSAML_XERCESC_HAS_XMLBYTE_RELEASE XMLString::release(&out); +#else + XMLString::release((char**)&out); +#endif return ret; } return string(); @@ -86,7 +94,7 @@ string SAMLArtifact::encode() const SAMLArtifact* SAMLArtifact::parse(const char* s) { // Decode and extract the type code first. - unsigned int len=0; + xsecsize_t len=0; XMLByte* decoded=Base64::decode(reinterpret_cast(s),&len); if (!decoded) throw ArtifactException("Artifact parser unable to decode base64-encoded artifact."); @@ -94,7 +102,11 @@ SAMLArtifact* SAMLArtifact::parse(const char* s) string type; type+= decoded[0]; type+= decoded[1]; +#ifdef OPENSAML_XERCESC_HAS_XMLBYTE_RELEASE XMLString::release(&decoded); +#else + XMLString::release((char**)&decoded); +#endif return SAMLConfig::getConfig().SAMLArtifactManager.newPlugin(type,s); }