mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
ITS#5770: Fix unaligned BerElements: Use BerElementBuffer, not char[size].
This commit is contained in:
parent
db5943fbd6
commit
dffe8d37fa
@ -1583,8 +1583,8 @@ tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count )
|
||||
#endif
|
||||
|
||||
if ( preread ) {
|
||||
char berbuf[LBER_ELEMENT_SIZEOF];
|
||||
BerElement *ber = (BerElement *)berbuf;
|
||||
BerElementBuffer berbuf;
|
||||
BerElement *ber = (BerElement *)&berbuf;
|
||||
char **attrs = NULL;
|
||||
|
||||
if( preread_attrs ) {
|
||||
@ -1613,8 +1613,8 @@ tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count )
|
||||
}
|
||||
|
||||
if ( postread ) {
|
||||
char berbuf[LBER_ELEMENT_SIZEOF];
|
||||
BerElement *ber = (BerElement *)berbuf;
|
||||
BerElementBuffer berbuf;
|
||||
BerElement *ber = (BerElement *)&berbuf;
|
||||
char **attrs = NULL;
|
||||
|
||||
if( postread_attrs ) {
|
||||
|
@ -364,8 +364,8 @@ static const char ppolicy_ctrl_oid[] = LDAP_CONTROL_PASSWORDPOLICYRESPONSE;
|
||||
static LDAPControl *
|
||||
create_passcontrol( Operation *op, int exptime, int grace, LDAPPasswordPolicyError err )
|
||||
{
|
||||
char berbuf[LBER_ELEMENT_SIZEOF], bb2[LBER_ELEMENT_SIZEOF];
|
||||
BerElement *ber = (BerElement *)berbuf, *b2 = (BerElement *)bb2;
|
||||
BerElementBuffer berbuf, bb2;
|
||||
BerElement *ber = (BerElement *) &berbuf, *b2 = (BerElement *) &bb2;
|
||||
LDAPControl c = { 0 }, *cp;
|
||||
struct berval bv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user