]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4621. [port] Force alignment of oid arrays to silence loader
authorMark Andrews <marka@isc.org>
Wed, 10 May 2017 23:24:36 +0000 (09:24 +1000)
committerMark Andrews <marka@isc.org>
Wed, 10 May 2017 23:24:36 +0000 (09:24 +1000)
                        warnings. [RT #45131]

CHANGES
lib/dns/spnego.c

diff --git a/CHANGES b/CHANGES
index bc94fddaef96597c49814db9d3508b3294a0a93d..a5b23556c8e3f41365307558251e360ef0e73a74 100644 (file)
--- 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]
 
index 23f8f7cfd5775a61fdaea1598e787446a94171af..f2e115fdab13d2fcf9a5822173f7f6965ffe8462 100644 (file)
@@ -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;