]> git.sur5r.net Git - openldap/commitdiff
ITS#5927, don't cache queries with malformed entries in results
authorHoward Chu <hyc@openldap.org>
Wed, 18 Feb 2009 23:11:28 +0000 (23:11 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 18 Feb 2009 23:11:28 +0000 (23:11 +0000)
servers/slapd/overlays/pcache.c

index b0b7c65c1c4bc4a32d73c4472b1affd1841cbecb..141cc20a7a2358db89aeb2b2a0ff9eb773b747fa 100644 (file)
@@ -1993,6 +1993,19 @@ pcache_op_cleanup( Operation *op, SlapReply *rs ) {
                                goto over;
                        }
 
+                       /* check for malformed entries: attrs with no values */
+                       {
+                               Attribute *a = e->e_attrs;
+                               for (; a; a=a->a_next) {
+                                       if ( !a->a_numvals ) {
+                                               Debug( pcache_debug, "%s: query not cacheable because of attrs without values in DN \"%s\" (%s)\n",
+                                               op->o_log_prefix, rs->sr_entry->e_name.bv_val,
+                                               a->a_desc->ad_cname.bv_val );
+                                               goto over;
+                                       }
+                               }
+                       }
+
                        if ( si->count < si->max ) {
                                si->count++;
                                e = entry_dup( rs->sr_entry );