MacOS UBSAN: another workaround

pull/772/head
Brad House 8 months ago
parent 4b37f22ff2
commit b40daa2c5b
  1. 7
      src/lib/ares_sysconfig_mac.c

@ -275,7 +275,12 @@ static ares_status_t read_resolvers(dns_resolver_t **resolvers, int nresolvers,
for (i = 0; status == ARES_SUCCESS && i < nresolvers; i++) {
const dns_resolver_t *resolver;
resolver = resolvers[i];
/* UBSAN doesn't like that this is unaligned, lets use memcpy to get the
* address, same as:
* resolver = resolvers[i]
*/
memcpy(&resolver, resolvers + i, sizeof(resolver));
status = read_resolver(resolver, sysconfig);
}

Loading…
Cancel
Save