X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Fhandler%2Fimpl%2FSAML2ArtifactResolution.cpp;h=bec9c016a3e5491565658db180273ecdc4d7b389;hb=2a81cfe0c57926f26e4876b821c6c0b2e70a2bc4;hp=1ea731722134872b83ef50492e61dc1cad62cf76;hpb=915538ad47f804e89d3a73cbbb08c20beb966f5f;p=shibboleth%2Fsp.git diff --git a/shibsp/handler/impl/SAML2ArtifactResolution.cpp b/shibsp/handler/impl/SAML2ArtifactResolution.cpp index 1ea7317..bec9c01 100644 --- a/shibsp/handler/impl/SAML2ArtifactResolution.cpp +++ b/shibsp/handler/impl/SAML2ArtifactResolution.cpp @@ -88,10 +88,8 @@ namespace shibsp { // Find maximum index in use and go one higher. const vector& services = const_cast(role).getArtifactResolutionServices(); - for (vector::const_iterator i = services.begin(); i != services.end(); ++i) { - if (ix.second <= (*i)->getIndex().second) - ix.second = (*i)->getIndex().second + 1; - } + if (!services.empty() && ix.second <= services.back()->getIndex().second) + ix.second = services.back()->getIndex().second + 1; const char* loc = getString("Location").second; string hurl(handlerURL);