mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
fix uninitialized last (NULL) entry in BerVarray
This commit is contained in:
parent
abf91ca1ff
commit
9b8ffc30ed
@ -51,7 +51,6 @@ monitor_subsys_backend_init(
|
||||
Entry *e, *e_backend, *e_tmp;
|
||||
int i;
|
||||
struct monitorentrypriv *mp;
|
||||
struct berval bv[2];
|
||||
|
||||
mi = ( struct monitorinfo * )be->be_private;
|
||||
|
||||
@ -73,11 +72,11 @@ monitor_subsys_backend_init(
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
bv[1].bv_val = NULL;
|
||||
e_tmp = NULL;
|
||||
for ( i = nBackendInfo; i--; ) {
|
||||
char buf[1024];
|
||||
BackendInfo *bi;
|
||||
char buf[1024];
|
||||
BackendInfo *bi;
|
||||
struct berval bv[ 2 ];
|
||||
|
||||
bi = &backendInfo[i];
|
||||
|
||||
@ -110,6 +109,7 @@ monitor_subsys_backend_init(
|
||||
|
||||
bv[0].bv_val = bi->bi_type;
|
||||
bv[0].bv_len = strlen( bv[0].bv_val );
|
||||
bv[1].bv_val = NULL;
|
||||
|
||||
attr_merge( e, monitor_ad_desc, bv );
|
||||
attr_merge( e_backend, monitor_ad_desc, bv );
|
||||
|
@ -50,7 +50,6 @@ monitor_subsys_database_init(
|
||||
AttributeDescription *ad_nc = slap_schema.si_ad_namingContexts;
|
||||
AttributeDescription *ad_seeAlso = NULL;
|
||||
const char *text = NULL;
|
||||
struct berval bv[2];
|
||||
|
||||
assert( be != NULL );
|
||||
assert( monitor_ad_desc != NULL );
|
||||
@ -116,7 +115,10 @@ monitor_subsys_database_init(
|
||||
}
|
||||
|
||||
for ( j = 0; be->be_suffix[j]; j++ ) {
|
||||
bv[0] = *be->be_suffix[j];
|
||||
struct berval bv[ 2 ];
|
||||
|
||||
bv[ 0 ] = *be->be_suffix[ j ];
|
||||
bv[ 1 ].bv_val = NULL;
|
||||
|
||||
attr_merge( e, ad_nc, bv );
|
||||
attr_merge( e_database, ad_nc, bv );
|
||||
@ -124,6 +126,8 @@ monitor_subsys_database_init(
|
||||
|
||||
for ( j = nBackendInfo; j--; ) {
|
||||
if ( &backendInfo[ j ] == be->bd_info ) {
|
||||
struct berval bv[ 2 ];
|
||||
|
||||
/* we check the pointer; the test on the
|
||||
* string should be more reliable */
|
||||
assert( strcasecmp( backendInfo[ j ].bi_type,
|
||||
@ -132,8 +136,9 @@ monitor_subsys_database_init(
|
||||
snprintf( buf, sizeof( buf ),
|
||||
"cn=Backend %d,%s",
|
||||
j, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn.bv_val );
|
||||
bv->bv_val = buf;
|
||||
bv->bv_len = strlen( buf );
|
||||
bv[ 0 ].bv_val = buf;
|
||||
bv[ 0 ].bv_len = strlen( buf );
|
||||
bv[ 1 ].bv_val = NULL;
|
||||
attr_merge( e, ad_seeAlso, bv );
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user