From cfbb52459be8369381d30e057032269e21dab15a Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Mon, 18 Jul 2005 14:09:47 +0000 Subject: [PATCH] Fix pointer error --- servers/slapd/back-bdb/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index 9ac83de447..232e996d49 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -356,12 +356,12 @@ bdb_cf_gen(ConfigArgs *c) bdb->bi_flags |= BDB_HAS_CONFIG; while ( fgets( buf, sizeof(buf), f )) { ber_str2bv( buf, 0, 1, &bv ); - if ( bv.bv_val[bv.bv_len-1] == '\n' ) { + if ( bv.bv_val > 0 && bv.bv_val[bv.bv_len-1] == '\n' ) { bv.bv_len--; bv.bv_val[bv.bv_len] = '\0'; } /* shouldn't need this, but ... */ - if ( bv.bv_val[bv.bv_len-1] == '\r' ) { + if ( bv.bv_val > 0 && bv.bv_val[bv.bv_len-1] == '\r' ) { bv.bv_len--; bv.bv_val[bv.bv_len] = '\0'; } -- 2.39.5