Description of problem:
> sasl_map_domap allocates strings for "base" and "filter" in it; the
> caller ids_sasl_user_to_entry releases them only when the function
> returns non-NULL regexmatch (matched), but even if the return value
> is NULL (did not match), the strings are allocated.
> Fix: underlying function sasl_map_check should free "base" and "filter"
> if mapping did not match.
Created attachment 531391 [details]
git patch file (master)
Bug Description: sasl_map_domap allocates strings for "base" and
"filter" in it; the caller ids_sasl_user_to_entry releases them
only when the function returns non-0 regexmatch (matched), but
even if the return value is 0 (did not match), the strings are
Fix Description: underlying function sasl_map_check frees "base"
and "filter" if mapping did not match.
Reviewed by Rich (Thank you!!)
Pushed to master.
Author: Noriko Hosoi <email@example.com>
Date: Tue Nov 1 16:03:57 2011 -0700
Bug 750622 - Fix Coverity (11104) Resource leak:
$ git merge 6af5ece3ca029271f2b2180c24bad546e2d64c45
ldap/servers/slapd/sasl_map.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
$ git push
Counting objects: 11, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 874 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)
c077173..6af5ece master -> master
Note: I bumped up the priority/severity high.
Based on comment#5, marking the bug as VERIFIED.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Previously, allocated memory was not correctly released in the underlying code for the SASL GSSAPI authentication method, when checking the Simple Authentication and Security Layer (SASL) identity mappings. This problem could cause memory leaks when processing SASL bind requests, which eventually caused the LDAP server to terminate unexpectedly with a segmentation fault. This update adds function calls that are needed to free allocated memory correctly. Memory leaks no longer occur and the LDAP server no longer crashes in this scenario.