https://bugs.openldap.org/show_bug.cgi?id=10347
Issue ID: 10347 Summary: Fix a memory leak in function comp_convert_asn_to_ldap Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: contrib Assignee: bugs@openldap.org Reporter: alexguo1023@gmail.com Target Milestone: ---
Created attachment 1076 --> https://bugs.openldap.org/attachment.cgi?id=1076&action=edit Patch: Fix a memory leak in function comp_convert_asn_to_ldap
In function comp_convert_asn_to_ldap, the bv->bv_val is allocated in 3 places:
case BASICTYPE_BOOLEAN: bv->bv_val = (char*)malloc( 5 ); case BASICTYPE_INTEGER: bv->bv_val = (char*)malloc( INITIAL_ATTR_SIZE ); case BASICTYPE_ENUMERATED: bv->bv_val = (char*)malloc( INITIAL_ATTR_SIZE );
When csi->csi_syntax != NULL and csi->csi_syntax->ssyn_pretty != NULL, bv->bv_val is overwriten with bv->bv_val = prettied.bv_val;, causing porential memory leak.
https://bugs.openldap.org/show_bug.cgi?id=10347
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.6.11 Keywords|needs_review |
--- Comment #1 from Quanah Gibson-Mount quanah@openldap.org --- Note: component matching contrib
https://bugs.openldap.org/show_bug.cgi?id=10347
Ondřej Kuzník ondra@mistotebe.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Assignee|bugs@openldap.org |ondra@mistotebe.net Status|UNCONFIRMED |IN_PROGRESS
--- Comment #2 from Ondřej Kuzník ondra@mistotebe.net --- Hi Alex, thanks for the report, I've prepared a slightly different patch and posted a merge request on Gitlab here: https://git.openldap.org/openldap/openldap/-/merge_requests/776
Could you check it still works for you? (If you want to post on the merge request, you might need your account confirmed, please post your account name here or on openldap-devel).
https://bugs.openldap.org/show_bug.cgi?id=10347
--- Comment #3 from Alex Guo alexguo1023@gmail.com --- Hi,
Thank you for confirming. This patch looks great to me. By the way, my GitHub username is mugitya233.
https://bugs.openldap.org/show_bug.cgi?id=10347
--- Comment #4 from Alex Guo alexguo1023@gmail.com --- (In reply to Alex Guo from comment #3)
Hi,
Thank you for confirming. This patch looks great to me. By the way, my GitHub username is mugitya233.
Gitlab
https://bugs.openldap.org/show_bug.cgi?id=10347
--- Comment #5 from Quanah Gibson-Mount quanah@openldap.org --- (In reply to Alex Guo from comment #4)
(In reply to Alex Guo from comment #3)
Hi,
Thank you for confirming. This patch looks great to me. By the way, my GitHub username is mugitya233.
Gitlab
We use our own hosted instance of gitlab. ;) You can follow the signup process if you anticipate making PRs in the future.
https://bugs.openldap.org/show_bug.cgi?id=10347
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |TEST
--- Comment #6 from Quanah Gibson-Mount quanah@openldap.org --- main:
• 9496132d by Ondřej Kuzník at 2025-06-20T14:52:19+00:00 ITS#10347 Be explicit about managing attr_bv storage
RE26:
• 99b53d8e by Ondřej Kuzník at 2025-09-08T22:10:25+00:00 ITS#10347 Be explicit about managing attr_bv storage
https://bugs.openldap.org/show_bug.cgi?id=10347
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED Resolution|TEST |FIXED