From bdb121c9674bcfcce1777c3755c24890125506ac Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 7 Feb 2009 15:09:18 +0000 Subject: [PATCH] discard attribute values if attribute name cannot be parsed (ITS#5927) --- servers/slapd/back-ldap/search.c | 5 +++-- servers/slapd/back-meta/search.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index a3718aca4c..a25ee8f4fa 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -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; } diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 6f237ea08e..2e65f004b3 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -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; } -- 2.39.5