]> git.sur5r.net Git - openldap/commitdiff
discard attribute values if attribute name cannot be parsed (ITS#5927)
authorPierangelo Masarati <ando@openldap.org>
Sat, 7 Feb 2009 15:09:18 +0000 (15:09 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 7 Feb 2009 15:09:18 +0000 (15:09 +0000)
servers/slapd/back-ldap/search.c
servers/slapd/back-meta/search.c

index a3718aca4c02d83829e413f9254faacec0f2b7fe..a25ee8f4fa19f20b1fd84c875032fc9372e42139 100644 (file)
@@ -640,7 +640,7 @@ ldap_build_entry(
 
                attr = attr_alloc( NULL );
                if ( attr == NULL ) {
-                       continue;
+                       return LDAP_OTHER;
                }
                if ( slap_bv2ad( &a, &attr->a_desc, &text ) 
                                != LDAP_SUCCESS )
@@ -652,6 +652,8 @@ ldap_build_entry(
                                        "%s ldap_build_entry: "
                                        "slap_bv2undef_ad(%s): %s\n",
                                        op->o_log_prefix, a.bv_val, text );
+
+                               ( void )ber_scanf( &ber, "x" /* [W] */ );
                                attr_free( attr );
                                continue;
                        }
@@ -674,7 +676,6 @@ ldap_build_entry(
                         * present...
                         */
                        ( void )ber_scanf( &ber, "x" /* [W] */ );
-
                        attr_free( attr );
                        continue;
                }
index 6f237ea08ec3c06068e22a56b972d61fa688b874..2e65f004b345cb6dec801fd02b925800b8302d19 100644 (file)
@@ -1830,7 +1830,7 @@ meta_send_entry(
                }
                attr = attr_alloc( NULL );
                if ( attr == NULL ) {
-                       continue;
+                       return LDAP_OTHER;
                }
                if ( slap_bv2ad( &mapped, &attr->a_desc, &text )
                                != LDAP_SUCCESS) {
@@ -1846,6 +1846,7 @@ meta_send_entry(
                                        mapped.bv_val, text );
 
                                Debug( LDAP_DEBUG_ANY, "%s", buf, 0, 0 );
+                               ( void )ber_scanf( &ber, "x" /* [W] */ );
                                attr_free( attr );
                                continue;
                        }
@@ -1868,7 +1869,6 @@ meta_send_entry(
                         * present...
                         */
                        ( void )ber_scanf( &ber, "x" /* [W] */ );
-
                        attr_free(attr);
                        continue;
                }