]> git.sur5r.net Git - openldap/commitdiff
From: h.b.furuseth@usit.uio.no
authorKurt Zeilenga <kurt@openldap.org>
Wed, 15 May 2002 20:55:43 +0000 (20:55 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 15 May 2002 20:55:43 +0000 (20:55 +0000)
Subject: Patch: str2entry() dereferences NULL  (ITS#1822)

entry.c:str2entry() prints pdn->bv_val even though pdn is always
NULL.  pdn was pretty dn before version 1.80.

servers/slapd/entry.c

index 48afbf5d9d3e99724999f9246196f253e7e1af56..b30598fab3bdf35ab0b45cfd25dc019ecfd21ddc 100644 (file)
@@ -109,8 +109,6 @@ str2entry( char *s )
                }
 
                if ( strcasecmp( type, "dn" ) == 0 ) {
-                       struct berval *pdn = NULL;
-
                        free( type );
 
                        if ( e->e_dn != NULL ) {
@@ -137,12 +135,12 @@ str2entry( char *s )
                                LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: "
                                        "entry %ld has invalid DN \"%s\"\n",
                                        (long) e->e_id,
-                                       pdn->bv_val ? pdn->bv_val : "" ));
+                                       e->e_dn ? e->e_dn : "" ));
 #else
                                Debug( LDAP_DEBUG_ANY, "str2entry: "
                                        "entry %ld has invalid DN \"%s\"\n",
                                        (long) e->e_id,
-                                       pdn->bv_val ? pdn->bv_val : "", 0 );
+                                       e->e_dn ? e->e_dn : "", 0 );
 #endif
                                entry_free( e );
                                return NULL;