diff options
| author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-08-31 09:56:35 +0000 |
|---|---|---|
| committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-08-31 09:56:35 +0000 |
| commit | 20da442593bb6f0413f702ed32bd9c52de944aba (patch) | |
| tree | ac837f98e8fc5d5988c606cad6b7a04bd6741a75 | |
| parent | 6710fec968ed73bc88c4c8ab67121be37b1fa785 (diff) | |
Fixed bug in lasso_logout_request_new_from_export() : now if a query message and if an attribute or element key / value is missing, return NULL
| -rw-r--r-- | lasso/Attic/protocols/logout_request.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/lasso/Attic/protocols/logout_request.c b/lasso/Attic/protocols/logout_request.c index 02596c38..4b96c16d 100644 --- a/lasso/Attic/protocols/logout_request.c +++ b/lasso/Attic/protocols/logout_request.c @@ -157,32 +157,72 @@ lasso_logout_request_new_from_query(gchar *query) /* RequestID */ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "RequestID"), 0); + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request), str); /* MajorVersion */ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "MajorVersion"), 0); + lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), str); + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } /* MinorVersion */ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "MinorVersion"), 0); + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request), str); /* IssueInstant */ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "IssueInstant"), 0); + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } lasso_samlp_request_abstract_set_issueInstant(LASSO_SAMLP_REQUEST_ABSTRACT(request), str); /* ProviderID */ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "ProviderID"), 0); + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } lasso_lib_logout_request_set_providerID(LASSO_LIB_LOGOUT_REQUEST(request), str); /* NameIdentifier */ str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "NameIdentifier"), 0); + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } identifier = lasso_saml_name_identifier_new(str); str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "NameQualifier"), 0); + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(identifier), str); str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "Format"), 0); - lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(identifier), str); - + if (str == NULL) { + g_datalist_clear(&gd); + g_object_unref(request); + return (NULL); + } + lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(identifier), str); lasso_lib_logout_request_set_nameIdentifier(LASSO_LIB_LOGOUT_REQUEST(request), LASSO_SAML_NAME_IDENTIFIER(identifier)); lasso_node_destroy(identifier); |
