diff --git a/CHANGES b/CHANGES index bc94fddaef..a5b23556c8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4621. [port] Force alignment of oid arrays to silence loader + warnings. [RT #45131] + 4620. [port] Handle EPFNOSUPPORT being returned when probing to see if a socket type is supported. [RT #45214] diff --git a/lib/dns/spnego.c b/lib/dns/spnego.c index 23f8f7cfd5..f2e115fdab 100644 --- a/lib/dns/spnego.c +++ b/lib/dns/spnego.c @@ -311,35 +311,39 @@ fix_dce(size_t reallen, size_t * len); #include "spnego_asn1.c" -static unsigned char gss_krb5_mech_oid_bytes[] = { - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x01, 0x02, 0x02 +/* + * Force the oid arrays to be isc_uint64_t aligned to silence warnings + * about the arrays not being properly aligned for (void *). + */ +typedef union { unsigned char b[8]; isc_uint64_t _align; } aligned8; +typedef union { unsigned char b[16]; isc_uint64_t _align[2]; } aligned16; + +static aligned16 gss_krb5_mech_oid_bytes = { + { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x01, 0x02, 0x02 } }; static gss_OID_desc gss_krb5_mech_oid_desc = { - sizeof(gss_krb5_mech_oid_bytes), - gss_krb5_mech_oid_bytes + 9, gss_krb5_mech_oid_bytes.b }; static gss_OID GSS_KRB5_MECH = &gss_krb5_mech_oid_desc; -static unsigned char gss_mskrb5_mech_oid_bytes[] = { - 0x2a, 0x86, 0x48, 0x82, 0xf7, 0x12, 0x01, 0x02, 0x02 +static aligned16 gss_mskrb5_mech_oid_bytes = { + { 0x2a, 0x86, 0x48, 0x82, 0xf7, 0x12, 0x01, 0x02, 0x02 } }; static gss_OID_desc gss_mskrb5_mech_oid_desc = { - sizeof(gss_mskrb5_mech_oid_bytes), - gss_mskrb5_mech_oid_bytes + 9, gss_mskrb5_mech_oid_bytes.b }; static gss_OID GSS_MSKRB5_MECH = &gss_mskrb5_mech_oid_desc; -static unsigned char gss_spnego_mech_oid_bytes[] = { - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x02 +static aligned8 gss_spnego_mech_oid_bytes = { + { 0x2b, 0x06, 0x01, 0x05, 0x05, 0x02 } }; static gss_OID_desc gss_spnego_mech_oid_desc = { - sizeof(gss_spnego_mech_oid_bytes), - gss_spnego_mech_oid_bytes + 6, gss_spnego_mech_oid_bytes.b }; static gss_OID GSS_SPNEGO_MECH = &gss_spnego_mech_oid_desc;