mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Fix pointer error
This commit is contained in:
parent
cd80d6d5ec
commit
cfbb52459b
@ -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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user