check the return code from ldap_parse_result
PATCH 1/1 check the return code from ldap_parse_result
Hi, Ian,
Here's another trivialish patch. If ldap_parse_result returns anything other than LDAP_SUCCESS, the values of the result pointers are undefined.
Cheers,
Jeff
Signed-off-by Jeff Moyer <[email protected]>
modules/lookup_ldap.c +7 -1
@@ -2017,6 +2017,12 @@ do_paged: sp->cookie =NULL ; } +if (rv !=LDAP_SUCCESS ) { +debug (ap->logopt, +MODPREFIX "ldap_parse_result failed with %d" , rv); + goto out_free; + } +/* * Parse the page control returned to get the cookie and * determine whether there are more pages.
@@ -2033,8 +2039,8 @@ do_paged:if (returnedControls)ldap_controls_free (returnedControls); +out_free:ldap_control_free (pageControl); -return rv; }