]> git.sur5r.net Git - openldap/commitdiff
Don't crash in slapi_send_ldap_search_entry if no attributes specified
authorLuke Howard <lukeh@openldap.org>
Sat, 26 Apr 2003 03:28:12 +0000 (03:28 +0000)
committerLuke Howard <lukeh@openldap.org>
Sat, 26 Apr 2003 03:28:12 +0000 (03:28 +0000)
servers/slapd/slapi/slapi_utils.c

index ec0488e20d578f24f844f258883b00e368ce8230..55f6e934facf0f8a0547c42bd1dcd2fa6d0126f2 100644 (file)
@@ -1408,8 +1408,12 @@ slapi_send_ldap_search_entry(
        AttributeName   *an = NULL;
        const char      *text;
 
-       for ( i = 0; attrs[ i ] != NULL; i++ ) {
-               ; /* empty */
+       if ( attrs != NULL ) {
+               for ( i = 0; attrs[ i ] != NULL; i++ ) {
+                       ; /* empty */
+               }
+       } else {
+               i = 0;
        }
 
        if ( i > 0 ) {