mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Remember to NULL terminate control arrays - not sure how I managed to
make this error in multiple places
This commit is contained in:
parent
f32bfe729f
commit
0582504893
@ -462,6 +462,7 @@ slapi_over_merge_controls( Operation *op, SlapReply *rs )
|
|||||||
ctrls[n_slapi_ctrls + i] = rs->sr_ctrls[i];
|
ctrls[n_slapi_ctrls + i] = rs->sr_ctrls[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ctrls[n_slapi_ctrls + n_rs_ctrls] = NULL;
|
||||||
|
|
||||||
rs->sr_ctrls = ctrls;
|
rs->sr_ctrls = ctrls;
|
||||||
|
|
||||||
|
@ -762,7 +762,8 @@ pblock_add_control( Slapi_PBlock *pb, LDAPControl *control )
|
|||||||
|
|
||||||
controls = (LDAPControl **)slapi_ch_realloc( (char *)controls,
|
controls = (LDAPControl **)slapi_ch_realloc( (char *)controls,
|
||||||
( i + 2 ) * sizeof(LDAPControl *));
|
( i + 2 ) * sizeof(LDAPControl *));
|
||||||
controls[i] = slapi_dup_control( control );
|
controls[i++] = slapi_dup_control( control );
|
||||||
|
controls[i] = NULL;
|
||||||
|
|
||||||
return pblock_set_default( pb, SLAPI_RESCONTROLS, (void *)controls );
|
return pblock_set_default( pb, SLAPI_RESCONTROLS, (void *)controls );
|
||||||
}
|
}
|
||||||
@ -818,7 +819,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value )
|
|||||||
LDAPControl **ctrls = NULL;
|
LDAPControl **ctrls = NULL;
|
||||||
|
|
||||||
pblock_get_default( pb, param, (void **)&ctrls );
|
pblock_get_default( pb, param, (void **)&ctrls );
|
||||||
if ( ctrls == NULL ) {
|
if ( ctrls != NULL ) {
|
||||||
/* free old ones first */
|
/* free old ones first */
|
||||||
ldap_controls_free( ctrls );
|
ldap_controls_free( ctrls );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user