mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Don't assume offsetof(foo,firstelement) is zero
This commit is contained in:
parent
1989cf6f42
commit
21796e671a
@ -986,7 +986,7 @@ static int parsePreRead (
|
||||
}
|
||||
|
||||
siz = sizeof( AttributeName );
|
||||
off = 0;
|
||||
off = offsetof( AttributeName, an_name );
|
||||
if ( ber_scanf( ber, "{M}", &an, &siz, off ) == LBER_ERROR ) {
|
||||
rs->sr_text = "preread control: decoding error";
|
||||
return LDAP_PROTOCOL_ERROR;
|
||||
@ -1035,7 +1035,7 @@ static int parsePostRead (
|
||||
}
|
||||
|
||||
siz = sizeof( AttributeName );
|
||||
off = 0;
|
||||
off = offsetof( AttributeName, an_name );
|
||||
if ( ber_scanf( ber, "{M}", &an, &siz, off ) == LBER_ERROR ) {
|
||||
rs->sr_text = "postread control: decoding error";
|
||||
return LDAP_PROTOCOL_ERROR;
|
||||
|
@ -159,7 +159,7 @@ do_search(
|
||||
|
||||
/* attributes */
|
||||
siz = sizeof(AttributeName);
|
||||
off = 0;
|
||||
off = offsetof(AttributeName,an_name);
|
||||
if ( ber_scanf( op->o_ber, "{M}}", &op->ors_attrs, &siz, off ) == LBER_ERROR ) {
|
||||
send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding attrs error" );
|
||||
rs->sr_err = SLAPD_DISCONNECT;
|
||||
|
Loading…
Reference in New Issue
Block a user