Don't assume offsetof(foo,firstelement) is zero

This commit is contained in:
Kurt Zeilenga 2003-11-19 18:04:49 +00:00
parent 1989cf6f42
commit 21796e671a
2 changed files with 3 additions and 3 deletions

View File

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

View File

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