diff options
author | benjamin.dauvergne <benjamin.dauvergne@a716ebb1-153a-0410-b759-cfb97c6a1b53> | 2010-09-28 15:54:25 +0000 |
---|---|---|
committer | benjamin.dauvergne <benjamin.dauvergne@a716ebb1-153a-0410-b759-cfb97c6a1b53> | 2010-09-28 15:54:25 +0000 |
commit | da3bd32b0f509812e163f4e72e6dc1442dc56d9d (patch) | |
tree | 98a87e518e9235bba4c4162e27d9f8b3c211ba6d | |
parent | c65b261fbe6fc0cbf6a750acc83181574db43912 (diff) | |
download | mod_auth_mellon-da3bd32b0f509812e163f4e72e6dc1442dc56d9d.tar.gz mod_auth_mellon-da3bd32b0f509812e163f4e72e6dc1442dc56d9d.tar.xz mod_auth_mellon-da3bd32b0f509812e163f4e72e6dc1442dc56d9d.zip |
Fix segfault when no assertion is found
git-svn-id: https://modmellon.googlecode.com/svn/trunk@107 a716ebb1-153a-0410-b759-cfb97c6a1b53
-rw-r--r-- | auth_mellon_handler.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c index 6587d74..fe9e160 100644 --- a/auth_mellon_handler.c +++ b/auth_mellon_handler.c @@ -774,6 +774,7 @@ static int am_init_logout_request(request_rec *r, LassoLogout *logout) char *redirect_to; LassoProfile *profile; LassoSession *session; + GList *assertion_list; LassoNode *assertion_n; LassoSaml2Assertion *assertion; LassoSaml2AuthnStatement *authnStatement; @@ -832,14 +833,15 @@ static int am_init_logout_request(request_rec *r, LassoLogout *logout) /* We currently only look at the first assertion in the list * lasso_session_get_assertions returns. */ - assertion_n = lasso_session_get_assertions( - session, profile->remote_providerID)->data; - if(LASSO_IS_SAML2_ASSERTION(assertion_n) == FALSE) { + assertion_list = lasso_session_get_assertions( + session, profile->remote_providerID); + if(! assertion_list || LASSO_IS_SAML2_ASSERTION(assertion_list->data) == FALSE) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "No assertions found for the current session."); lasso_logout_destroy(logout); return HTTP_INTERNAL_SERVER_ERROR; } + assertion_n = assertion_list->data; assertion = LASSO_SAML2_ASSERTION(assertion_n); |