Skip to content
Snippets Groups Projects
Commit 5007e922 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix empty dn.

parent dd1bb178
Branches
Tags
No related merge requests found
......@@ -103,9 +103,11 @@ main( int argc, char **argv )
fprintf( stderr, "entry %ld has no dn\n",
id );
} else {
(void) dn_normalize_case( val );
if( val != NULL ) {
(void) dn_normalize_case( val );
}
key.dptr = val;
key.dsize = strlen( val ) + 1;
key.dsize = strlen( val != NULL ? val : "" ) + 1;
data.dptr = (char *) &id;
data.dsize = sizeof(ID);
if ( ldbm_store( db->dbc_db, key, data,
......
......@@ -88,14 +88,17 @@ main( int argc, char **argv )
fprintf( stderr, "entry %ld has no dn\n",
id );
} else {
(void) dn_normalize_case( val );
if( val != NULL ) {
(void) dn_normalize_case( val );
}
#ifndef DN_INDICES
key.dptr = val;
key.dsize = strlen( val ) + 1;
key.dsize = strlen( val != NULL ? val : "" ) + 1;
#else
key.dsize = strlen( val ) + 2;
key.dsize = strlen( val != NULL ? val : "" ) + 2;
key.dptr = ch_malloc( key.dsize );
sprintf( key.dptr, "%c%s", DN_BASE_PREFIX, val );
sprintf( key.dptr, "%c%s", DN_BASE_PREFIX,
val != NULL ? val : "" );
#endif
data.dptr = (char *) &id;
data.dsize = sizeof(ID);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment