From: Simo Sorce Date: Sat, 9 Jun 2007 18:18:24 +0000 (+0000) Subject: r23404: Fix wrong (and missing) action on error condition in ldap reply evaluation... X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=176e1c0b692b9509a29bbbb2b35ad821dfb0d5aa;p=thirdparty%2Fsamba.git r23404: Fix wrong (and missing) action on error condition in ldap reply evaluation loop Fixes one of the segfaults in bug #4667 --- diff --git a/source/nsswitch/idmap_ldap.c b/source/nsswitch/idmap_ldap.c index 7fdf16beaae..e5dd658fe38 100644 --- a/source/nsswitch/idmap_ldap.c +++ b/source/nsswitch/idmap_ldap.c @@ -965,7 +965,7 @@ again: } if ( ! entry) { DEBUG(2, ("ERROR: Unable to fetch ldap entries from results\n")); - continue; + break; } /* first check if the SID is present */ @@ -1180,6 +1180,10 @@ again: } else { /* following ones */ entry = ldap_next_entry(ctx->smbldap_state->ldap_struct, entry); } + if ( ! entry) { + DEBUG(2, ("ERROR: Unable to fetch ldap entries from results\n")); + break; + } /* first check if the SID is present */ sidstr = smbldap_talloc_single_attribute(