From: Howard Chu Date: Tue, 16 May 2006 21:30:10 +0000 (+0000) Subject: Fix ITS#4450, don't overwrite remote server's rs->sr_text X-Git-Tag: OPENLDAP_REL_ENG_2_4_3ALPHA~9^2~254 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5f3bc1f7ec72515357249613fb51d64f0fb74258;p=openldap Fix ITS#4450, don't overwrite remote server's rs->sr_text --- diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index de4180e65a..dbe612d549 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -375,16 +375,19 @@ retry: } } else { - char **references = NULL; + char **references = NULL, *err = NULL; rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err, - &match.bv_val, (char **)&rs->sr_text, + &match.bv_val, &err, &references, &rs->sr_ctrls, 1 ); - freetext = 1; if ( rc != LDAP_SUCCESS ) { rs->sr_err = rc; } rs->sr_err = slap_map_api2result( rs ); + if ( err ) { + rs->sr_text = err; + freetext = 1; + } if ( references && references[ 0 ] && references[ 0 ][ 0 ] ) { int cnt;