https://issues.shibboleth.net/jira/browse/SSPCPP-319
[shibboleth/cpp-sp.git] / shibsp / Application.cpp
index 43139f3..3a459f8 100644 (file)
@@ -66,6 +66,8 @@ pair<string,const char*> Application::getCookieNameProps(const char* prefix, tim
 
     if (lifetime)
         *lifetime = 0;
+    if (!prefix)
+        prefix = "";
     const PropertySet* props=getPropertySet("Sessions");
     if (props) {
         if (lifetime) {
@@ -78,12 +80,12 @@ pair<string,const char*> Application::getCookieNameProps(const char* prefix, tim
             p.second=defProps;
         pair<bool,const char*> p2=props->getString("cookieName");
         if (p2.first)
-            return make_pair(string(prefix) + p2.second,p.second);
-        return make_pair(string(prefix) + getHash(),p.second);
+            return make_pair(string(prefix) + p2.second, p.second);
+        return make_pair(string(prefix) + getHash(), p.second);
     }
 
     // Shouldn't happen, but just in case..
-    return pair<string,const char*>(prefix,defProps);
+    return pair<string,const char*>(prefix, defProps);
 }
 
 void Application::clearHeader(SPRequest& request, const char* rawname, const char* cginame) const
@@ -129,7 +131,7 @@ void Application::clearAttributeHeaders(SPRequest& request) const
             out = getServiceProvider().getListenerService()->send(in);
             if (out.islist()) {
                 DDF header = out.first();
-                while (header.isstring()) {
+                while (header.name() && header.isstring()) {
                     m_unsetHeaders.push_back(pair<string,string>(header.name(),header.string()));
                     header = out.next();
                 }
@@ -160,3 +162,7 @@ const Handler* Application::getAssertionConsumerServiceByProtocol(const XMLCh* p
     const vector<const Handler*>& handlers = getAssertionConsumerServicesByBinding(b.get());
     return handlers.empty() ? nullptr : handlers.front();
 }
+
+void Application::limitRedirect(const GenericRequest& request, const char* url) const
+{
+}