summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Laniel <dlaniel@entrouvert.com>2006-11-14 09:59:09 +0000
committerDamien Laniel <dlaniel@entrouvert.com>2006-11-14 09:59:09 +0000
commitd7fe76847480884b000e2caf2ad18d6916a2c500 (patch)
treeffca3362aa6cee31a9715a528585e03c0fa076a1
parent3fa164f916c5b9ee7627cded9804638a1b5b1fb6 (diff)
Test on a possibly NULL pointer to avoid seg fault
-rw-r--r--lasso/saml-2.0/login.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lasso/saml-2.0/login.c b/lasso/saml-2.0/login.c
index 283295e5..033f543d 100644
--- a/lasso/saml-2.0/login.c
+++ b/lasso/saml-2.0/login.c
@@ -781,6 +781,8 @@ lasso_saml20_login_process_response_status_and_assertion(LassoLogin *login)
if (LASSO_SAMLP2_RESPONSE(response)->Assertion) {
LassoProfile *profile = LASSO_PROFILE(login);
LassoSaml2Assertion *assertion = LASSO_SAMLP2_RESPONSE(response)->Assertion->data;
+ if (profile->remote_providerID == NULL)
+ return LASSO_ERROR_UNDEFINED;
idp = g_hash_table_lookup(profile->server->providers, profile->remote_providerID);
if (idp == NULL)
return LASSO_ERROR_UNDEFINED;
@@ -793,7 +795,7 @@ lasso_saml20_login_process_response_status_and_assertion(LassoLogin *login)
}
profile->nameIdentifier = g_object_ref(assertion->Subject->NameID);
-
+
if (LASSO_PROFILE(login)->nameIdentifier == NULL)
return LASSO_ERROR_UNDEFINED;
}