ITS#5770: Fix unaligned BerElements: Use BerElementBuffer, not char[size].

This commit is contained in:
Hallvard Furuseth 2008-10-24 17:52:05 +00:00
parent db5943fbd6
commit dffe8d37fa
2 changed files with 6 additions and 6 deletions

View File

@ -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 ) {

View File

@ -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;