https://bugs.openldap.org/show_bug.cgi?id=10328
Issue ID: 10328 Summary: Possible multiple free() calls in rewrite_subst_compile() Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: libraries Assignee: bugs@openldap.org Reporter: gyf161023@gmail.com Target Milestone: ---
In rewrite_subst_compile() of libraries/librewrite/subst.c line 216 and 222, `subs` and `submatch` array are freed repeatedly on the index `nsub` instead of l, is this what was intended or the `nsub` has some guarantee to be 1 so that we are not freeing anything for second time?
https://bugs.openldap.org/show_bug.cgi?id=10328
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |hyc@openldap.org Keywords|needs_review | Target Milestone|--- |2.5.20
https://bugs.openldap.org/show_bug.cgi?id=10328
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |IN_PROGRESS Ever confirmed|0 |1
--- Comment #1 from Howard Chu hyc@openldap.org --- https://git.openldap.org/openldap/openldap/-/merge_requests/765
Looks like this code has never been hit, since it only executes on parse errors.
https://bugs.openldap.org/show_bug.cgi?id=10328
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- • e5a545d5 by Howard Chu at 2025-04-24T16:47:31+00:00 ITS#10328 librewrite: fix substitution cleanup
https://bugs.openldap.org/show_bug.cgi?id=10328
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |FIXED
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- RE26:
• a6f1dd31 by Howard Chu at 2025-05-06T15:54:23+00:00 ITS#10328 librewrite: fix substitution cleanup
RE25:
• b34494fa by Howard Chu at 2025-05-06T15:54:28+00:00 ITS#10328 librewrite: fix substitution cleanup