util: specify the maximum-size element when initialize union

Fixes oss-fuzz#11344.
This commit is contained in:
Yu Watanabe 2018-11-12 00:35:57 +09:00
parent f57dfcba08
commit adea26ee62
1 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,9 @@ static inline size_t FAMILY_ADDRESS_SIZE(int family) {
return family == AF_INET6 ? 16 : 4;
}
#define IN_ADDR_NULL ((union in_addr_union) {})
/* Workaround for clang, explicitly specify the maximum-size element here.
* See also oss-fuzz#11344. */
#define IN_ADDR_NULL ((union in_addr_union) { .in6 = {} })
void in_addr_data_hash_func(const void *p, struct siphash *state);
int in_addr_data_compare_func(const void *a, const void *b);