mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 18:49:34 -05:00
Don't segfault on malformed configuration
This commit is contained in:
parent
95f0c5d5e2
commit
7e31732cc5
1 changed files with 11 additions and 0 deletions
|
|
@ -321,6 +321,7 @@ meta_back_db_config(
|
|||
fprintf( stderr,
|
||||
"%s: line %d: need \"uri\" directive first\n",
|
||||
fname, lineno );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( argc != 2 ) {
|
||||
|
|
@ -347,6 +348,7 @@ meta_back_db_config(
|
|||
fprintf( stderr,
|
||||
"%s: line %d: need \"uri\" directive first\n",
|
||||
fname, lineno );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( argc != 2 ) {
|
||||
|
|
@ -376,6 +378,7 @@ meta_back_db_config(
|
|||
fprintf( stderr,
|
||||
"%s: line %d: need \"uri\" directive first\n",
|
||||
fname, lineno );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( argc != 2 ) {
|
||||
|
|
@ -402,6 +405,7 @@ meta_back_db_config(
|
|||
fprintf( stderr,
|
||||
"%s: line %d: need \"uri\" directive first\n",
|
||||
fname, lineno );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( argc != 2 ) {
|
||||
|
|
@ -523,6 +527,13 @@ meta_back_db_config(
|
|||
} else if ( strcasecmp( argv[ 0 ], "map" ) == 0 ) {
|
||||
int i = li->ntargets-1;
|
||||
|
||||
if ( i < 0 ) {
|
||||
fprintf( stderr,
|
||||
"%s: line %d: need \"uri\" directive first\n",
|
||||
fname, lineno );
|
||||
return 1;
|
||||
}
|
||||
|
||||
return ldap_back_map_config( &li->targets[ i ]->oc_map,
|
||||
&li->targets[ i ]->at_map,
|
||||
fname, lineno, argc, argv );
|
||||
|
|
|
|||
Loading…
Reference in a new issue