From: Luke Howard Date: Fri, 4 Apr 2003 04:06:18 +0000 (+0000) Subject: Don't segfault on malformed configuration X-Git-Tag: AUTOCONF_2_57~81 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7e31732cc5832c8b33574f7be836d5cfe7009bb9;p=openldap Don't segfault on malformed configuration --- diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index 87ae4e76f4..f8d3fc5d30 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -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 );