remove some excessive UBSAN workaround

v1.29
Brad House 6 months ago
parent dc46b4fb63
commit 22495e3a6c
  1. 6
      src/lib/ares_sysconfig_mac.c

@ -310,7 +310,6 @@ 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_ptr;
dns_resolver_t resolver;
/* UBSAN doesn't like that this is unaligned, lets use memcpy to get the
* address. Equivalent to:
@ -318,10 +317,7 @@ static ares_status_t read_resolvers(dns_resolver_t **resolvers, int nresolvers,
*/
memcpy(&resolver_ptr, resolvers + i, sizeof(resolver_ptr));
/* UBSAN. If the pointer is misaligned, try to use memcpy to get the data
* into a new structure that is hopefully aligned properly */
memcpy(&resolver, resolver_ptr, sizeof(resolver));
status = read_resolver(&resolver, sysconfig);
status = read_resolver(resolver_ptr, sysconfig);
}
return status;

Loading…
Cancel
Save