[samlv2 logout] check that the assertion is well formed before accessing the subject nameid

This commit is contained in:
Benjamin Dauvergne 2010-12-17 17:40:28 +01:00
parent 8c28926304
commit 126a9ac71c
1 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,10 @@ lasso_saml20_logout_init_request(LassoLogout *logout, LassoProvider *remote_prov
assertion = (LassoSaml2Assertion*)assertion_n;
/* Set the NameID */
goto_cleanup_if_fail_with_rc(assertion->Subject != NULL,
LASSO_PROFILE_ERROR_MISSING_SUBJECT);
goto_cleanup_if_fail_with_rc(assertion->Subject->NameID != NULL,
LASSO_PROFILE_ERROR_MISSING_NAME_IDENTIFIER);
lasso_assign_gobject(logout_request->NameID, assertion->Subject->NameID);
/* Encrypt NameID */