Ticket #6 (new defect)

Opened 8 months ago

Last modified 8 months ago

Simplication and memory leak in lasso_saml2_name_id_management_process_request

Reported by: bdauvergne Assigned to: dlaniel
Priority: minor Milestone: 2.2
Component: lasso Version: 2.1.1
Severity: memleak Keywords:
Cc:

Description

In lasso/saml-2.0/name_id_management.c, function lasso_saml2_name_id_management_process_request. It seems that variable encrypted_element is useless, that encrypted_id value is leaked and that some of the control flow code is redundant.

Old code

encrypted_id = LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST(profile->request)->EncryptedID;

if (name_id == NULL && encrypted_id != NULL) {

encryption_private_key = profile->server->private_data->encryption_private_key; encrypted_element = LASSO_SAML2_ENCRYPTED_ELEMENT(encrypted_id); if (encrypted_element != NULL && encryption_private_key == NULL) {

return LASSO_PROFILE_ERROR_MISSING_ENCRYPTION_PRIVATE_KEY;

} if (encrypted_element != NULL && encryption_private_key != NULL) {

profile->nameIdentifier = LASSO_NODE(lasso_node_decrypt(

encrypted_id, encryption_private_key));

LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST(profile->request)->NameID = \

LASSO_SAML2_NAME_ID(profile->nameIdentifier);

LASSO_SAMLP2_MANAGE_NAME_ID_REQUEST(profile->request)->EncryptedID = NULL;

}

======

Attachments

nid_management_process_request.diff (2.2 kB) - added by bdauvergne on 13.03.2008 17:11:57.
Patch for memleak in lasso_saml2_name_id_management_process_request

Change History

13.03.2008 17:11:57 changed by bdauvergne

  • attachment nid_management_process_request.diff added.

Patch for memleak in lasso_saml2_name_id_management_process_request

14.03.2008 10:58:52 changed by fpeters

  • owner changed from fpeters to dlaniel.

Add/Change #6 (Simplication and memory leak in lasso_saml2_name_id_management_process_request)




Change Properties
Action